Jump to content
Sign in to follow this  
Didonet

Image in gui

Recommended Posts

Didonet

How to put an image into the gui? Not like a button, just like a label. But an image.

And... how to get the name of the resource of the image when I add it with the command

#AutoIt3Wrapper_res_File_Add=menu.jpg

:P

Share this post


Link to post
Share on other sites
searchresult

$Pic1 = GUICtrlCreatePic("C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Blue hills.jpg", 72, 104, 100, 100)

Share this post


Link to post
Share on other sites
Valuater

FileInstall()

Example....

$Sample_pic = @TempDir & "\Sample.jpg"
FileInstall("C:\Program Files\AutoIt3\Examples\AutoIt-123\Images\Sample-GUI.jpg", $Sample_pic)

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Didonet

how to get it from the exe's resource? 0.o

Share this post


Link to post
Share on other sites
Didonet

I don't have "sample.jpg" or other kind of picture file. I have put the picture in the exe's resources and from there i must get the resource...how? :P

Share this post


Link to post
Share on other sites
SmOke_N

Don't bump so close to each other, look in the example forum for Zedna's post on resources.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
Didonet

uhh.. sorry for the fast dumb, but i don't have any patience... i want to finish the program faster (lol)

Ok, I look Zedna's post... but, i don't want so many options. I need only to insert a image on the gui from the exe's resources. Or to set it like a background. :P

Share this post


Link to post
Share on other sites
SmOke_N

uhh.. sorry for the fast dumb, but i don't have any patience... i want to finish the program faster (lol)

Ok, I look Zedna's post... but, i don't want so many options. I need only to insert a image on the gui from the exe's resources. Or to set it like a background. :P

1st, it doesn't matter what you want... we are not an On-Demand IT Support forum, we answer when we are ready to answer, and if and or when we find your post and feel like answering we will.

2nd, the functions you need are in there, again, it doesn't matter what you want, it matters if it works... if you can customize them to be less code then feel free.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
Didonet

errm... sorry... :P

I read the Zedna's codes and i edit the codes and i create what i want.

But... can i put the image behind the text?

Share this post


Link to post
Share on other sites
Zedna

errm... sorry... :P

I read the Zedna's codes and i edit the codes and i create what i want.

But... can i put the image behind the text?

#AutoIt3Wrapper_Res_File_Add=image1.bmp, bitmap, TEST_BMP_1
#include <GUIConstants.au3>
#include "resources.au3"

 $gui = GUICreate("Data from resources example",820,500)
$pic1 = GUICtrlCreatePic("",0,0,400,300)
GUICtrlSetState(-1,$GUI_DISABLE)
_ResourceSetImageToCtrl($pic1, "TEST_BMP_1", $RT_BITMAP)
GUICtrlCreateLabel("TEST",20,20,400,300)
GUICtrlSetFont (-1,14, 800, 2, "Comic Sans MS")
GUICtrlSetColor(-1, 0x00FF00)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUISetState(@SW_SHOW)

While 1
    If GUIGetMsg() = -3 Then Exit
WEnd

Share this post


Link to post
Share on other sites
Didonet

thanks! :P

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  

×