- 中查找“bcb 拷 屏 代 码”更多相关内容
- 中查找“bcb 拷 屏 代 码”更多相关内容
- ·上一篇文章:病毒的编制关键技术(2)
- ·下一篇文章:用bcb 读磁片磁区
bcb 拷 屏 代 码
TCanvas *dtCanvas = new TCanvas;
dtCanvas->Handle=GetDC(0);
Graphics::TBitmap *bitmap=new Graphics::TBitmap;
bitmap->Width=Width;
bitmap->Height=Height;
int nColors=GetDeviceCaps(Canvas->Handle,SIZEPALETTE);
LOGPALETTE* logPal=(LOGPALETTE*)new Byte[sizeof(LOGPALETTE)+(nColors-1)*sizeof(PALETTEENTRY)];
logPal->palVersion=0x300; logPal->palNumEntries=(Word)nColors;
GetSystemPaletteEntries(Canvas->Handle,0,nColors,logPal->palPalEntry);
bitmap->Palette=CreatePalette(logPal);
delete[] logPal;
TRect src=BoundsRect;
TRect dest=Rect(0,0,Width,Height);
bitmap->Canvas->CopyRect(dest,dtCanvas,src);
bitmap->SaveToFile("Screen.bmp");
delete bitmap;
delete dtCanvas;
Tags:
作者:佚名评论内容只代表网友观点,与本站立场无关!
评论摘要(共 0 条,得分 0 分,平均 0 分)
查看完整评论