pranaynanda Posted March 7, 2017 Posted March 7, 2017 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
InnI Posted March 7, 2017 Posted March 7, 2017 1. File not found. 2. File is not a bmp-file. Check the @error macros.
pranaynanda Posted March 7, 2017 Author Posted March 7, 2017 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.
orbs Posted March 7, 2017 Posted March 7, 2017 @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
pranaynanda Posted March 7, 2017 Author Posted March 7, 2017 (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 March 7, 2017 by pranaynanda
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now