近期遇到了一下图像处理的问题,特总结一下
BCB截图
一、画布(Canvas)
Graphics::TBitmap* bmp=new Graphics::TBitmap;
TCanvas* canvas=new TCanvas;
HDC hdc=GetDC(NULL);
canvas->Handle=hdc;
bmp->Width=Screen->Width;
bmp->Height=Screen->Height;
bmp->Canvas->CopyRect(Rect(0,0,bmp->Width,bmp->Height),canvas,Rect(0,0,bmp->Width,bmp->Height));
二、API(BitBlt())
HDC hdc=CreateDCA("DISPLAY",NULL,NULL,NULL);
Graphics::TBitmap* bmp=new Graphics::TBitmap;
bmp->Width=Screen->Width;
bmp->Height=Screen->Height;
::BitBlt(bmp->Canvas->Handle,0,0,Screen->Width,Screen->Height,hdc,0,0,SRCCOPY);
/*******************************************************************************/
给自己图片加个水印样式
Graphics::TBitmap* bmp1=new Graphics::TBitmap;
bmp1->LoadFromFile("c://s.bmp");
Graphics::TBitmap* bmp2=new Graphics::TBitmap;
bmp2->LoadFromFile("c://000.bmp");
::BitBlt(bmp1->Canvas->Handle,0,0,bmp2->Width,bmp2->Height,bmp2->Canvas->Handle,0,0,SRCAND);
标签:总结,TBitmap,BCB,Height,Width,bmp,图像处理,Graphics,Screen
From: https://blog.51cto.com/u_15487030/7523383