Jump to content

Draw image


ram4nd
 Share

Recommended Posts

#include <GUIConstantsEx.au3> ;must
#include <StaticConstants.au3> ;must
#include <WindowsConstants.au3> ;must

Global $Form1 = GUICreate("My First Square", 600, 500) ;must

ShapeCreation() ;Calls the ShapeCreation function

GUISetState(@SW_SHOW)  ;must
While 1           ;must                  
    $nMsg = GUIGetMsg() ;must
    Switch $nMsg ;must
    Case $GUI_EVENT_CLOSE ;must
        Exit ;must

Func ShapeCreation()   ;The ShapeCreation function     


$Square = GUICtrlCreateGraphic(220, 250, 100, 100)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff00, 0xff00) ;The color of the shape
GUICtrlSetGraphic(-1, $GUI_GR_RECT, 50, 50, 80, 80) ;The shape of the it(Square) (x, y, width, length)


GUICtrlSetStyle(-1, $SS_NOTIFY) ;A must in order for images to show correctly
EndFunc


EndSwitch ;must
WEnd ;must

That lets you draw a green square, observe the code =p

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