devxlogo

Loading Bitmaps

Loading Bitmaps

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

Answer:
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

See also  How College Students Can Shape the Future of Tech Responsibility
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist