GraaF1337 Posted November 22, 2014 Share Posted November 22, 2014 (edited) I'm unable to resize my Graphic? Edited November 22, 2014 by GraaF1337 Link to comment Share on other sites More sharing options...
GraaF1337 Posted November 22, 2014 Author Share Posted November 22, 2014 (edited) Wow! I've been so stupid! Totally forgot the GUICtrlSetPos Command! >.< Replacing my "GUICtrlSetGraphic" with this: GUICtrlSetPos($drawinggui,100 + $side, 100 + $up) Did the job! Still need to resize it tho! Edited November 22, 2014 by GraaF1337 Xandy 1 Link to comment Share on other sites More sharing options...
GraaF1337 Posted November 22, 2014 Author Share Posted November 22, 2014 I'm unable to resize the graphic? Understand me right, i want to make the graphic bigger after it have been drawn? Link to comment Share on other sites More sharing options...
GraaF1337 Posted November 22, 2014 Author Share Posted November 22, 2014 Just tried to use "GuiCtrlSetData" to resize the graphic, that doesn't seem to work.. expandcollapse popup#include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <StaticConstants.au3> #NoTrayIcon $Form1 = GUICreate("Change Drawing", 617, 440, 192, 124) GUISetState(@SW_SHOW) $size = 100 $drawinggui = GUICtrlCreateGraphic(75, 75, $size, $size) GUICtrlSetColor($drawinggui, 0xFF0000) $update = GUICtrlCreateButton("Update", 100, 20) $plus = GUICtrlCreateButton("+", 143, 20, 15) $min = GUICtrlCreateButton("-", 85, 20, 15) $show2 = GUICtrlCreateLabel($size, 112, 50) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $update GUICtrlSetData($drawinggui, $size) Case $plus $size +=10 GUICtrlSetData($show2, $size) Case $min $size -=10 GUICtrlSetData($show2, $size) EndSwitch WEnd Link to comment Share on other sites More sharing options...
GraaF1337 Posted November 22, 2014 Author Share Posted November 22, 2014 Any ideas? Link to comment Share on other sites More sharing options...
Developers Jos Posted November 22, 2014 Developers Share Posted November 22, 2014 (edited) Relax ... Don't bump your threads within 24 hours. ps your initial post is confusing as that states **Solved**. Jos Edited November 22, 2014 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
GraaF1337 Posted November 22, 2014 Author Share Posted November 22, 2014 Relax ... Don't bump your threads within 24 hours. ps your initial post is confusing as that states **Solved**. Jos Fixed and sorry >.< Link to comment Share on other sites More sharing options...
minxomat Posted November 22, 2014 Share Posted November 22, 2014 Graphics do not have "sizes". You can do this: GuiCtrlCreateGraphic(0,0) and you can still draw anywhere in the GUI's client area. If you want to scale the drawn elements, you could make them dynamic by placing their coords in an array. I will answer every single PM, and you are free to ask anything anytime. Link to comment Share on other sites More sharing options...
TheSaint Posted November 23, 2014 Share Posted November 23, 2014 (edited) Are you trying to create a larger graphic from an existing small one, or are you just trying to display it bigger? If the latter, then use GUICtrlSetImage, having first created a control (i.e. Label) of the specified size you want. If the former, then you need to study both the GDIPlus and WinAPI sections of the User Defined Function (UDF) section of the AutoIt Help file. Have a go at knocking some code up, and we will help you with any issues. UDF is the last section. Edited November 23, 2014 by TheSaint Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
GraaF1337 Posted November 23, 2014 Author Share Posted November 23, 2014 I want to do something like, draw a graphic, then if i press "+" or "-" it will either make the graphic bigger or small once i click the "update" button. I tried this but it dont work.. expandcollapse popup#include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <StaticConstants.au3> #NoTrayIcon $Form1 = GUICreate("Change Drawing", 617, 440, 192, 124) GUISetState(@SW_SHOW) $size = 100 $drawinggui = GUICtrlCreateGraphic(75, 75, $size, $size) GUICtrlSetColor($drawinggui, 0xFF0000) $update = GUICtrlCreateButton("Update", 100, 20) $plus = GUICtrlCreateButton("+", 143, 20, 15) $min = GUICtrlCreateButton("-", 85, 20, 15) $show2 = GUICtrlCreateLabel($size, 112, 50) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $update GUICtrlSetData($drawinggui, $size) Case $plus $size +=10 GUICtrlSetData($show2, $size) Case $min $size -=10 GUICtrlSetData($show2, $size) EndSwitch WEnd Link to comment Share on other sites More sharing options...
Developers Jos Posted November 23, 2014 Developers Share Posted November 23, 2014 Helpfile is your friend Case $update GUICtrlSetPos($drawinggui,75,75, $size,$size) Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
GraaF1337 Posted November 23, 2014 Author Share Posted November 23, 2014 Helpfile is your friend Case $update GUICtrlSetPos($drawinggui,75,75, $size,$size) Jos Facking love you sometimes! Thank you alot! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now