Sign in to follow this  
Followers 0
JayHawkfl

Display a pic on a gui

5 posts in this topic

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Form1", 1409, 694, 190, 122)
$Pic1 = GUICtrlCreatePic("C:\Users\Unity\Documents\remember wanting to shave\Apartment.bmp", 8, 8, 908, 476)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

    EndSwitch
WEnd

I'm using Autoit to make a game and I need to display pictures of what going on in this 2d story thing

I've tried a few diffrent things resizing both the file and the gui and the the GUICtrlCreatePic

i've tried all the supported file extensions and double and triple checked my file path.

What am I doing wrong here....

Attached pic

Apartment.bmp


Thanks for your time

 

Share this post


Link to post
Share on other sites



There's something odd about your BMP file.  As is, it does not display.  But I brought it into MSPaint and wrote it out under a different name.  It doubled in size and then displayed correctly with your script.  I didn't notice anything in particular except the size.  Both BMPs report as 24 bit.

Share this post


Link to post
Share on other sites

use Format Factory 2.70 and convert bmp......

Apartment.bmp (Size: 1.25 to 3.30 MB)


I am new, i am not programmer.....

Sorry my bad English......

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

The attached BMP is not a BMP but a PNG! And some PNGs making problems using GUICtrlCreatePic directly.

There are some workarounds already posted using GDI+. Just search for it.

When I convert your image to real bmp format than it works as expected.

Edited by 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

I see so I didn't convert it properly. Thanks Everyone


Thanks for your time

 

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