Page 1 of 1

How to get the Hardware Device Context for an Image object?

Posted: Tue Jun 25, 2024 4:07 pm
by Rav
In APL+Win, they have a Picture object which can be accessed with low-level Windows API functions via ⎕WCALL or ⎕NA. In order to do that, they provide an hdc (Hardware Device Context) property which the Windows API requires. Even if they didn't provide an hdc, they also provide a hwnd (Windows handle) property, with which one could retrieve an hdc using the Windows GetWindowDC or GetDC function.

In Dyalog, if I understand correctly, the analog to APL+Win's Picture object is the Image object. The problem is that Image objects have neither an hdc nor an hwnd property, so I can't figure out how I can address them with the Windows API.

Is there a way to get the Handle or HDC for a Picture object? Or, if the Picture object refers to a Bitmap, a way to get a Handle or HDC to that Bitmap?

Thanks /Rav