Get Device Context (hDC)

Forums for specific tips, techniques and example code
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Get Device Context (hDC)

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:26 pm

by kathrin.jens >> Tue, 20 Jun 2000 23:11:17 GMT

Hi,

Does anybody can help me with the device context of controls, especially picture controls. I need the DC for a number of API calls (such as
BitBlt in GDI32). Since JADE does not provide this handle (similar to
the hwnd). What I'm doing at the moment is having a method at the
Picture class:

hDC():Integer updating;begin

return call getDC(hwnd);
end;

calling the GetDC function of User32. Whenever, I need to pass the
handle to the DC of the picture, i call this method. Although it returns a value (handle) it does not seem to work when refreshing the window. If the window on which the picture sits is minimised and opened again, or partially covered by another window the assigned bitmap (with BitBlt,
not .picture) is not shown. The .autoRedraw property is set to true.

Do I have to create the DC for the picture control first (CresteDC in UserDC), before calling the handle (GetDC)? Or is there another way to get the handle to the device context for picture controls? As I understand, if the .autoRedraw property is set to true, the DC handle returns a handle to the content (e.g. bitmap) of a picture control
rather than the control itself.

Any help very much appreciated!

Jens

Return to “Tips and Techniques”

Who is online

Users browsing this forum: No registered users and 25 guests

cron