Jex Posted November 29, 2007 Share Posted November 29, 2007 (edited) I'm trying create line without use GUICtrlSetGraphic ( $GUI_GR_LINE ) or _GDIPlus_GraphicsDrawLineBut my Mathematics not good.#include <GUIConstants.au3> $Width = 500 $Height = 500 $Form = GUICreate("Test", $Width, $Height) Line(50, 50, 450, 400) Func Line($x, $y, $x2, $y2) GUICtrlCreateGraphic(0, 0, $Width, $Height) $Step = (($x2 - $x) + ($y2 - $y)) For $i = 1 To $Step GUICtrlSetGraphic(-1, $GUI_GR_PIXEL, $x + ($i * (($x2 - $x) / $Step)), $y + ($i * (($y2 - $y) / $Step))) Next GUISetState() EndFunc Do Until GUIGetMsg() = -3I'm created that but i think that completely wrong.I think here explain how to create line but i'm didnt understood : http://en.wikipedia.org/wiki/Line_(mathematics) Edited November 29, 2007 by Jex My scripts : Immediate Window , My Web Browser , Travian , Text Effect , Characters & Words per minute or second , Image Editor (ImageMagick) , Matrix style background effect ( Screensaver ) , Mail Sender , Protectlinks decoder and Rapidshare links checker , Fonts Fetcher , Region determine , Compare pictures , Gradient color box , Mouse Coordinates, Colors, Pixel Search things , Encrypt/Decrypt and embeding file in jpeg thing , Hard disk space monitor , Reflex game , Multiplayer Tic Tac Toe , WLM ( MSN ) personal message changer Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 29, 2007 Share Posted November 29, 2007 I'm trying create line without use GUICtrlSetGraphic ( $GUI_GR_LINE ) or _GDIPlus_GraphicsDrawLineBut my Mathematics not good.I'm created that but i think that completely wrong.I think here explain how to create line but i'm didnt understood : http://en.wikipedia.org/wiki/Line_(mathematics)Doesn't do negative slope. Try Line(450, 400, 50, 50).Test it with mixed conditions of $x > $x2, $y > $y2, and with 0 and infinite slope:Line(50, 50, 450, 450)Line(450, 450, 50, 50)Line(50, 450, 450, 50)Line(450, 50, 50, 450)Line(250, 50, 250, 450)Line(50, 250, 450, 250)Line(250, 450, 250, 50)Line(450, 250, 50, 250)Good start though! Keep at it. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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