当前位置:主页>销售管理软件> 列表

请问用纯的API方法把一个BMP文件画到FORM上去应该怎 找零售管理

库存管理软件版1楼: 请问用纯的API方法把一个BMP文件画到FORM上去应该怎么做?
谢谢!!!

2楼: http://www.delphibbs.com/delphibbs/dispq.asp?lid=2045335 如零售管理

3楼: xiexie 啊啊啊啊啊

procedure TForm1.FormPaint(Sender: TObject);
var
DC : HDC;
HBMP : HBITMAP;
BITDC : HDC;
Pal: tagLOGPALETTE;
Palette : HPALETTE;
begin
DC := Form1.Canvas.Handle ;
HBMP := LoadBitmap(0,PChar(OBM_CHECKBOXES));
BITDC := CreateCompatibleDC(0);
SelectObject(BITDC,HBMP);
BitBlt(DC, 10, 10, 100, 100, BITDC, 0, 0, SRCCOPY);
DeleteObject(HBMP);
DeleteDC(BITDC);
end;
这段代码可以实现画图的功能,可还有一个问题LoadBitmap(0,PChar(OBM_CHECKBOXES));
是从资源文件里取出一个BMP文件来画在FORM1上,但我想从文件夹里随意取出一个BMP文件来画在FORM1上,这应该怎么做乃? 谢谢!!!

4楼: LPTSTR MAKEINTRESOURCE(

WORD wInteger // integer to convert
);

5楼: MAKEINTRESOURCE这个函数应该不行吧?

6楼: NT下LoadBitmap已经推荐不用了!使用LoadImage
HANDLE LoadImage(

HINSTANCE hinst, // handle of the instance that contains the image
LPCTSTR lpszName, // name or identifier of image
UINT uType, // type of image
int cxDesired, // desired width
int cyDesired, // desired height
UINT fuLoad // load flags
);