Jump to content

PNG Images


Recommended Posts

http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]
Link to comment
Share on other sites

I've found lod3n's script, but that is using a PNG for the entire GUI. I'm looking to do it for one control (As you can see, i'm a noob :rolleyes: ).

This is from the Yahoo AutoIt Group, posted by valery_vi http://tech.groups.yahoo.com/group/AutoItList/message/31198

This script shows Torus.png (from Auto3Lib) inside Pic control:

#include <A3LGDIPlus.au3>
Global $hGUI, $Pic, $hPic, $hImage, $hGraphic

; Create GUI
$hGUI = GUICreate("Show PNG", 400, 400)
$Label = GUICtrlCreateLabel('Auto3Lib shows PNG file', 130, 20, 150, 20)

_GDIP_StartUp()

GUISetState()

$Pic = GUICtrlCreatePic('',80,80, 240, 240)
$hPic = ControlGetHandle("Show PNG", "", "Static2")

; Load PNG image
$hImage = _GDIP_ImageLoadFromFile(@ScriptDir & "\Torus.png")

; Draw PNG image
$hGraphic = _GDIP_GraphicsCreateFromHWND($hPic)
_GDIP_GraphicsDrawImage($hGraphic, $hImage, 0, 0)

; Loop until user exits
do
until GUIGetMsg() = $GUI_EVENT_CLOSE

; Clean up resources
_GDIP_GraphicsDispose($hGraphic)
_GDIP_ImageDispose($hImage)
_GDIP_ShutDown()

This method was used in ALS script (see above messages), too.

Valery

Link to comment
Share on other sites

  • 1 month later...

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...