Need some help with Windows bitmaps...

BlitzPlus Forums/BlitzPlus Programming/Need some help with Windows bitmaps...

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I did a lot of Delphi programming which used a Canvas. This was just a wrapper around a windows device context which could be the printer, screen or an image in memory. You couldn't ever assign a bitmap directly to a Canvas as they weren't the same thing. I don't know if this helps but here is the help text for Canvas.Handle in Delphi:


Handle is the Windows GDI handle to the device context for this canvas.

property Handle: HDC;

Description

Set Handle to the HDC for the device context the canvas must draw into. When a windowed control responds to a Windows paint message, the HDC for drawing is passed in to the PaintWindow method. In other cases, an HDC can be obtained for a window by calling the GetDeviceContext method of a control. Additionally, Windows provides API calls to obtain an HDC for a printer or for a memory image.
Read the Handle property to supplement the drawing services provided by the TCanvas object with API calls that require a handle to a device context. Most of the Windows GDI calls require an HDC.

TCanvas does not own the HDC. Applications must create an HDC and set the Handle property. Applications must release the HDC when it is no longer needed by the canvas. Setting the Handle property of a canvas that already has a valid HDC will not automatically release the initial HDC.