drawing image with wxMax

BlitzMax Forums/Brucey's Modules/drawing image with wxMax

Peter(Posted 2011) [#1]
So far I managed to draw an image to on a window, but the image appears not in its original colors on the screen.

How do I use the SetBlend command together with wxMax? Or is there a similar function to resolve the problem?

- Peter


Brucey(Posted 2011) [#2]
Are you drawing a pixmap to a window or a TImage to a canvas on a window?
You are using FreeImage and which platform?
Thanks ;-)


Peter(Posted 2011) [#3]
I'm drawing a wxBitmap (converted from a wxImage) on a wxPaintDC (created on a wxScrolledWindow) during an OnPaint event.

I'm not using FreeImage (so far).

Platform: Windows (XP, 7)

I found an example somewhere (don't remember where at the moment) which describes the above method.

-- Peter

Last edited 2011


Peter(Posted 2011) [#4]
Seems my problem goes down unnoticed ...

-- Peter


Peter(Posted 2011) [#5]
Using the FreeImage library to load and convert the images to a wxImage solves the problem (if anyone is interested).

-- Peter


Brucey(Posted 2011) [#6]
This is an example of loading and drawing a GIF image in wxMax, based on code from another post :



Henri(Posted 2015) [#7]
Hi y'all,

sorry to do some midnight digging , but sense I wandered here there might be a chance that someone else does too. So I believe that the problem is related to format (big/little endian) the pixmap is in meaning that if you see inverse colors you may need to convert from PF_BGRA8888 to PF_RGBA8888 (notice the red,green and blue element placement).


TPixmap has Convert-method which can be used like this:
pixmap:TPixmap = pixmap.Convert(PF_RGBA8888)

-Henri