Jump to content

Display a pic on a gui


 Share

Recommended Posts

#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

 

Link to comment
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.

Link to comment
Share on other sites

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
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
 Share

  • Recently Browsing   0 members

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