Sign in to follow this  
Followers 0
timmy2

Autoit unable to properly display bmp images - bug?

3 posts in this topic

In a script I'm using the GuiCtrlSetImage command to display a bmp image created in Illustrator. When exporting to bmp from Illustrator the Basic options include 16 bit, 24 bit, and 32 bit.  (all are RGB, 72ppi, with anti-aliasing = "art optimized" (though I tried "none" and it made no difference to the outcomes shown))

Following are screen captures of how AutoIt's GuiCtrlSetImage command renders the bmp image.

32 bit original (note ragged edges)

32bitexample.png

 

24 bit original (looks closest to original, but there are some black pixel artifacts in the top left chrome border, so it ain't perfect)

24bitexamplelargertosho.png

 

16 bit original (note lots of breakup in chrome border and black pixels around border of white silhouette)

16bitexample.png

 

As you see, the 24 bit capture is the only acceptable one. However, I had to compromise on the graphic because originally it had "inner glow" effects in the white areas. Below is a screen capture of what AutoIt did to this 24 bit image.  The only difference between this and the previous 24 bit image is that this one has an inner glow (gray to white gradient along edges of white silhoutte) effect.

24bitexamplewithinnergl.png

 

Either there's a bug in AutoIt or my bmp files are incompatible in some way.  Can anyone tell me the ideal specs for a bmp image for use with GuiCtrlSetImage?  In case it helps, below are some of Illustrator's Advanced Export-to-bmp options (I used the Basic Modes described at the top). Note also that I brought the image into Photoshop and saved it as a bump there, and I got the same artifacts.

 

illustratoradvancedbmpo.png

Share this post


Link to post
Share on other sites



Often the search function is your friend: 

 

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

Thank you for replying. I had used the Search function here but apparently with the wrong criteria.

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  
Followers 0

  • Similar Content

    • wakillon
      By wakillon
      Create water effects using waterctrl.dll.
       
      Topic
       

    • Michiel
      By Michiel
      I'm trying to use '?do=embed' frameborder='0' data-embedContent>> but none of the examples work. Mostly, I'm just not seeing any pictures, just nothing, a window with some text but no picture. What am I doing wrong? Do these examples work for anybody else?
    • Shanheavel
      By Shanheavel
      I'd like to load a BMP file then change chosen color (0xFF00FF) to transparent and save it as PNG file. I'm using a code from other thread. I've modified it a little, but it still doesn't work.
      My program displays image with transparent color correctly, however saves a black image file.
      #include <Constants.au3> #include <WinAPIEx.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <ScreenCapture.au3> #include <WinAPI.au3> Global Const $STM_SETIMAGE = 0x0172 Global Const $STM_GETIMAGE = 0x0173 $hForm = GUICreate('MyGUI', 400, 400) $Pic = GUICtrlCreatePic('', 50, 50, 144, 87) $hPic = GUICtrlGetHandle(-1) _GDIPlus_Startup() $hDstDC = _WinAPI_CreateCompatibleDC(0) $hBitmap = _WinAPI_CreateSolidBitmap(0, _WinAPI_GetSysColor($COLOR_3DFACE), 144, 87, 0) $hDstSv = _WinAPI_SelectObject($hDstDC, $hBitmap) $hSrcDC = _WinAPI_CreateCompatibleDC(0) $hImg = _WinAPI_LoadImage(0, @ScriptDir & '\piclvq.bmp', $IMAGE_BITMAP, 0, 0, $LR_LOADFROMFILE) $hSrcSv = _WinAPI_SelectObject($hSrcDC, $hImg) _WinAPI_TransparentBlt($hDstDC, 0, 0, 144, 87, $hSrcDC, 0, 0, 144, 87, 0xFF00FF) $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hForm) $hImage = _GDIPlus_BitmapCreateFromGraphics(144, 87, $hGraphic) ; Save resultant image _GDIPlus_ImageSaveToFile($hImage, "My_transparent_image.png") _WinAPI_SelectObject($hDstDC, $hDstSv) _WinAPI_DeleteDC($hDstDC) _WinAPI_SelectObject($hSrcDC, $hSrcSv) _WinAPI_DeleteDC($hSrcDC) _WinAPI_DeleteObject($hImg) _WinAPI_DeleteObject(_SendMessage($hPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hBitmap)) $hPic = _SendMessage($hPic, $STM_GETIMAGE) If $hPic <> $hBitmap Then _WinAPI_DeleteObject($hBitmap) EndIf GUISetState() Do Until GUIGetMsg() = -3 piclvq.bmp
    • Jfish
      By Jfish
      Hello all.  I am trying to figure out the best approach to compare PDF outputs for consistency.  Currently, this is a human task where PDFs are held up to a light to see if all the values line up exactly with test data.  I have to believe there is a better way.  That said GDIPlus is a bit of a mystery to me - I have looked at some of the functions - and I stumbled upon >this very useful script in my forum search.  My question is: would converting the PDF to an image and comparing the image with GDIPlus be the way to go or is there a different more efficient approach that you would recommend?  Any guidance would be greatly appreciated.
      JFish
    • timmy2
      By timmy2
      Here's a simple script I'm testing the ScreenCapture function with.
      #include <ScreenCapture.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> ; Capture region _ScreenCapture_Capture(@ScriptDir & "\image.bmp", 290,18,1465,652,0) $form=GUICreate("Test",1175,634,290,18,BitOR($WS_SYSMENU,$WS_POPUP),$WS_EX_COMPOSITED) $PSimage=GUICtrlCreatePic(@ScriptDir & "\image.bmp", 0,0,1175,634) GUISetState(@SW_SHOW) MsgBox(0,"","Test of screen cap and display.") .
      The above script captures an area of the screen (the SciTE editor with this script open), writes it to image.bmp, and displays image.bmp. The problem I'm having is when image.bmp is displayed using GUICtrlCreatePic the result is fuzzy.  Here's a SnagIt screen capture of what GUICtrlCreatePic displays.

       
      Attached is image.bmp, which is sharp and equivalent to seeing the actual script open in SciTE on-screen.
      Any suggestions for displaying an accurate rendition of ScreenCapture's output? (Must be borderless, no chrome, etc. -- equivalent to what my test script yields.)
      image.bmp