Jump to content

MS Paint for Cheap


jvanegmond
 Share

Recommended Posts

I was complete and utterly bored so i built a little gui with a editable Graphic control. It reminds me a bit of paint, but it's just not that good.. :D

#include <GUIConstants.au3>
#include <Misc.au3>

Global $Mode = 0, $Color = 0xff0000

GUICreate("Editor Concept", 350,300)
GUISetBkColor(0)

$Line = GUICtrlCreateButton("Line", 300,0,50,50)
$Dot = GUICtrlCreateButton("Dot", 300,50,50,50,$SS_CENTER)
$ColorBtn = GUICtrlCreateButton("Select" & @LF & "Color", 300,100,50,50,BitOr($SS_CENTER,$BS_MULTILINE))
$ColorLbl = GUICtrlCreateLabel("", 300,150,50,20,$SS_CENTER)
GUICtrlSetBkColor(-1, $Color)

$Graphic = GUICtrlCreateGraphic(0,0,300,300)
GUICtrlSetGraphic($Graphic,$GUI_GR_COLOR, $Color)
GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    
    If $msg = -3 Then
        Exit
    ElseIf $msg = $Dot Then
        $Mode = 0
    ElseIf $msg = $Line Then
        $Mode = 1
    ElseIf $msg = $ColorBtn Then
        $NewColor = _ChooseColor (2, $Color, 2)
        If Not @error Then
            $Color = $NewColor
            GUICtrlSetBkColor($ColorLbl, $Color)
            GUICtrlSetGraphic($Graphic,$GUI_GR_COLOR, $Color)
        EndIf
    EndIf
    
    $Mouse = GUIGetCursorInfo()
    
    If $Mouse[2] = 1 AND $Mouse[4] = $Graphic Then
        If $Mode = 1 Then
            GUICtrlSetGraphic($Graphic,$GUI_GR_MOVE,$Mouse[0],$Mouse[1])
            While $Mouse[2] = 1
                $Mouse = GUIGetCursorInfo()
            WEnd
            GUICtrlSetGraphic($Graphic,$GUI_GR_LINE,$Mouse[0],$Mouse[1])
        ElseIf $Mode = 0 Then
            GUICtrlSetGraphic($Graphic,$GUI_GR_DOT,$Mouse[0],$Mouse[1])
        EndIf
        GUICtrlSetGraphic($Graphic,$GUI_GR_REFRESH)
    EndIf
WEnd

Exit
Link to comment
Share on other sites

lol works quite reasonably actually :D

Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Link to comment
Share on other sites

  • 1 month later...

I created a program based on this script recently - it allows you to draw freehand, and perfectly straight lines, and rectangles, and ellipses, and insert labels, and insert pictures, and insert a webpage, and I'm getting bored saying and, so I'll give whoever wants it the link:

Topic: http://www.autoitscript.com/forum/index.ph...Paint+For+Cheap

Download: http://www.autoitscript.com/fileman/users/callender.p1/GroupTeach%20Files/GroupTeachV0.2B_FORUM.zip

Hope you like it.

EDIT: Always get double lines for some stupid reason...

Edited by Pa Callender
[size="4"]YOU SHALL NOT PARSE!![/size]
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...