Jump to content
Sign in to follow this  
Fur

Image won't show in color

Recommended Posts

So I have this image map.bmp my DLL has generated and I'm trying to view with GuiCtrlCreatePic(), but it always shows in a grey scale. Is there something I'm missing?

The BMP may have an issue with the pallet or something, but every other tool I own will open it and display it just fine...

map.bmp

#include <GUIConstants.au3>
GUICreate("My GUI picture",150,150,-1,-1,$WS_SIZEBOX+$WS_SYSMENU) ; will create a dialog box that when displayed is centered

$n=GUICtrlCreatePic(@Workingdir & "\map.bmp",0,0,100,100)
GUISetState (@SW_SHOW)

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

Share this post


Link to post
Share on other sites

Yes, its saved as 32 bit, which is supposed to actually only contain 24 bit worth of color, just each pixel is padded out by 8 extra bits. Just like 24 bit, its not supposed to contain a pallet. My code just uses LoadImage() to load them, which works fine for me. That is what I would assume is what AutoIt would use to load them, but apparently not!

I'll look at your code, thanks!

Share this post


Link to post
Share on other sites

Hmm.. that's what I figured, you're saving as 24 bit. I prefer keeping mine in 32 bit, because all my code uses 32 bit DIBs for the raw speed in searching them in memory. I guess I can have it write out two versions one in 24 bit and one in 32 bit as a workaround. Maybe I can get BitBlt() to do the conversion for me..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...