在桌面上绘图
1、在头文件中界说变量
private:
graphics::tbitmap *bmp;
2、图象变量的初始化:
bmp=new graphics::tbitmap();
bmp->loadfromfile("c:\\aboutlogo.bmp");
3、在paint的事件中
void __fastcall tform1::formpaint(tobject *sender)
{
hdc hdk;
trect rect;
application->minimize();
hdk=getwindowdc(getdesktopwindow());
getwindowrect(getdesktopwindow(),&rect);
bitblt(hdk,(rect.width()-bmp->width)/2,(rect.height()-bmp->height)/2,bmp->width,bmp->height,bmp->canvas->handle,0,0,srccopy);
}
4。销毁tbitmap工具
delete bmp;
以上措施在c++ builder 5+winnt 4.0下实现.