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);
Graphics::TBitmap *BufferBmp = new Graphics::TBitmap();
BufferBmp->LoadFromFile("C:\\3423.bmp");
BitBlt(Panel1->Handle,0,0,Panel1->Width,Panel1->Height,BufferBmp->Canvas->Handle,0,0,SRCCOPY);
delete BufferBmp ;
| Bitmap - 位图,.bmp 图片 | |||||||||||||||||||||||||||
| 说明: TBitmap: 可以处理 bmp 图片、位图,内置画布,可做为内存位图
头文件: #include <Vcl.Graphics.hpp> (XE2 之后),#include <Graphics.hpp> (XE 之前)
继承关系: TObject → TPersistent → TInterfacedPersistent → TGraphic → TBitmap
属性:
|

5622

被折叠的 条评论
为什么被折叠?



