首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

gdi 载入图片 到hdc解决方法

2012-01-28 
gdi 载入图片 到hdcgdi 中,怎么把图片载入到hdc 中?网上找的现在都是gdi+ 的。我是这样写的,但hdc里没东西

gdi 载入图片 到hdc
gdi 中,怎么把图片载入到hdc 中?
网上找的现在都是gdi+ 的。

我是这样写的,但hdc里没东西啊


VB code
Public Function GdiLoadPicture(ByVal hdc As Long, ByVal FileName As String, Optional bWidth As Long = 0, Optional bHeight As Long = 0) As Long  DeleteDC hdc  hdc = CreateCompatibleDC(0)    Dim bmp As Long  Dim bw As Long, bh As Long  bmp = LoadImage(0, FileName, IMAGE_BITMAP, bw, bh, LR_LOADFROMFILE)      SelectObject hdc, bmp  End Function


LoadImage是个API

[解决办法]
先得到hwnd,然后用GetDc得到hDC
[解决办法]
看看这个:
http://www.programbbs.com/doc/2942.htm

热点排行