BCB图像处理总结

近期遇到了一下图像处理的问题,特总结一下

 

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);

你可能感兴趣的:(BCB图像处理总结)