ijl
[TUT] Delphi Graphic Tutorials
Started By
Mansherry
, Dec 13 2015 05:28 PM
#26
Posted 14 November 2017 - 11:42 AM
#28
Posted 28 January 2018 - 09:54 AM
#28
Posted 28 January 2018 - 09:54 AM
Firstly open a form and add image and button on the form.1. First we will draw a single line on the image. To draw a line delphi needs two points from us.we give the first point of the line with the command "MoveTo". We will use the start of the image max left,max up which means 0,0 parametars of X and Y. If we want to go down we increse the X and if we want to go right we increse Y.Click twice on the button or go into OnClick button event(its same) and write this:Next we need the secound point which we give with the command "LineTo".Same like the MoveTo command it needs two values (X,Y). We will use the middle of the image, so we will find the middle of the image if we split the Width and the Height of the image on 2.so the next code will be :if we want to countinue from the place we stoped the first line now we just use line to otherways we have set the new start point with move tonotice the difference between :
and:
on the first image we countinue the secound line from the place we finished the first and in the secound we set new starting point.To change the line color use this code:change the blue with the name of the color you want.i should note now about the TPoint variables.the Tpoint variables have 2 values x and y and they are very usefull for drawing.I am really bored now i will continue tomorrow with expanding this tutorial with rectangels , ellipses etc.
get banned
Users browsing this thread: