Jump to content

Recommended Posts

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

 

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.

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.

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

WinPose - simultaneous fluent move and resize

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

Magic Math - a math puzzle

Demos:

Title Bar Menu - click the window title to pop-up a menu

 

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...