Re: win32Lib pixmap
- Posted by ghaberek (admin) Nov 23, 2014
- 1507 views
If I then put the images on that window, the images disappear when the window is scrolled.
It sounds like you are not drawing the image on the window during its paint event.
When attempting to place the image on the pixmap, the program fails at this line:
status=GdipCreateFromHWND(getHandle(VirtScrn),ppGraphics)
The "handle" of a Pixmap is the memory address of its underlying Bitmap object (a raw HANDLE value in Windows). The "handle" of a Window is its HWND value from Windows, which is what GdipCreateFromHWND() is expecting. HWND specifically means, Handle of a WiNDow. A Pixmap object is not a window, it is an in-memory Bitmap that can be used like a control.
The value of status is 3.. indicating "out of memory HWND". If use getHandle(ChartWin), a normal window, status is 0 and the image is drawn.
I would think both VirtScrn and ChartWin are atoms, but I could be incorrect.
They are both integer values. All values returned from create() (or createEx()) are simple integers that reference internal sequences used by Win32Lib to store data about the controls.
-Greg