Jump to content
Sign in to follow this  
Champak

Image not loading into GUI

Recommended Posts

Champak

Please take a look at this image. I can open the file just fine by double clicking it and right click preview, but I can't open it in paint shop or in a GUI. I can open it fine in Microsoft Paint, and then when I save it as a jpg in MS Paint....which it is already a jpg, I can then open it in Paint Shop, but more importantly in a GUI. How can I fix, remedy, work around this? Can I do this as an object in the background? Or is there something I'm missing?

Image.rar.rar

Edited by Champak

Share this post


Link to post
Share on other sites
wolf9228

Please take a look at this image. I can open the file just fine by double clicking it and right click preview, but I can't open it in paint shop or in a GUI. I can open it fine in Microsoft Paint, and then when I save it as a jpg in MS Paint....which it is already a jpg, I can then open it in Paint Shop, but more importantly in a GUI. How can I fix, remedy, work around this? Can I do this as an object in the background? Or is there something I'm missing?

Use GDIPlus library To Save image In a new file

#Include <GDIPlus.au3>
#include <GuiConstantsEx.au3>

_GDIPlus_Startup ()
$hImage = _GDIPlus_ImageLoadFromFile ( "StockImage.jpg")
_GDIPlus_ImageSaveToFile ($hImage,"GDIPlus_Image.jpg")
$Width =_GDIPlus_ImageGetWidth($hImage)
$Height = _GDIPlus_ImageGetHeight($hImage)
_GDIPlus_ShutDown ()
GUICreate("My GUI picture", $Width + 10, $Height + 20, 10, 10)  ; will create a dialog box that when displayed is centered
GUISetBkColor(0xE0FFFF)
GUICtrlCreatePic("GDIPlus_Image.jpg", 5, 5, $Width, $Height)
GUISetState()
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd

صرح السماء كان هنا

 

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.