Loading Bitmaps

Loading Bitmaps

I am having trouble transferring a bitmap that I loaded withthe LoadBitmap call from a resource to a picturebox. Howdo I do that?

The LoadBitmap call returns you a hWnd to the created bitmap. You should be able to use the GetDC API call to convert that hWnd and the hWnd of the picture box to hDC (device contexts), and then you can load those into the BitBlt function. You will have to look at the help for it in the Windows 3.1 SDK help file for more information, but that should get you going on the right track. The API declaration for GetDC is:

Declare Function GetDC Lib “user” (ByValhWnd%) As Integer


Share the Post: