Jump to content
Sign in to follow this  
SWINX

How to show a JPG file?

Recommended Posts

SWINX

This works:

GUICtrlCreateButton ("my picture button", 10,20,40,40, $BS_ICON)
GUICtrlSetImage (-1, "shell32.dll",22)

But when I try to show a JPG, it doesn't work out.

I also tried this:

$imgInstallFiles = GUICtrlCreatePic("..\_shared\true.jpg", 10, 53, 15, 15)

But also that didn't show my picture :)

Also tried to specify the full path to the image, but nothing seems to work :D

Somebody who knows why, and how to fix it?

Share this post


Link to post
Share on other sites
quaizywabbit

i think bitmaps and icons are the only image types allowed for buttons

from the helpfile: " In both case the $BS_ICON or $BS_BITMAP styles are needed to select the type of the picture used."

You can use GUICtrlCreatePic and assign events to it, but it won't appear to push and release like a button does...

Edited by quaizywabbit

[u]Do more with pre-existing apps![/u]ANYGUIv2.8

Share this post


Link to post
Share on other sites
zcoacoaz

i accomplished it before :) just make it so when the image is clicked it changes pictures


[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Share this post


Link to post
Share on other sites
SWINX

I didn't see there where different types to set.

I will convert my JPG to BMP and use the $BS_BITMAP style.

Thanks for your replies :)

Edited by SWINX

Share this post


Link to post
Share on other sites
SWINX

It still didn't work, but the problem seemd to be you have to specify a FULL path, it works fine now.

Share this post


Link to post
Share on other sites
Kerberuz

It still didn't work, but the problem seemd to be you have to specify a FULL path, it works fine now.

<{POST_SNAPBACK}>

Try using macros in your code. It will make your code more portable and easier to work with.

Example:

$Funnybtn = GUICtrlCreatePic(@WorkingDir & "\msgbox.jpg",0,0,0,0)

Aye, What Slim said... :)

Edited by Kerberuz

Kerby

Share this post


Link to post
Share on other sites
SlimShady

I suggest @ScriptDir instead of @WorkingDir

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  

×