pranaynanda

Image wont show in GUI

5 posts in this topic

#1 ·  Posted

Hi! I'm trying to do a simple job of displaying an image in GUI but it doesn't work. i tried using KODA but it does not work.

 

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Form1", 615, 438, 192, 124)
Global $Pic1 = GUICtrlCreatePic("C:\Users\iamauser\Pictures\pictures\picture.bmp", 112, 88, 420, 180)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

 

Share this post


Link to post
Share on other sites



#2 ·  Posted

1. File not found.

2. File is not a bmp-file.

Check the @error macros.

Share this post


Link to post
Share on other sites

#3 ·  Posted

I followed your suggestions and got found that $Pic1 returns 0 which implies that the picture cannot be created. But the picture is there and accessible by other image viewing programs like MSPaint and Windows Photo Viewer.

Share this post


Link to post
Share on other sites

#4 ·  Posted

@pranaynanda,

there is nothing wrong with your code. it works for me when i put a BMP image in a folder and name similar to yours.

check the full path name (you might have an extra "\pictures" in there) and the validity of the image file.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

The path is correct. I can be sure because it was taken up by Koda when I was trying to configure the image in the form using the load option in the Picture function. However, I do not understand what you mean by validity of the image.

Edited by pranaynanda

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