ALERT!
Click here to register with a few steps and explore all our cool stuff we have to offer!

Jump to content



Photo

[TUT] Delphi Graphic Tutorials


  • Please log in to reply
[TUT] Delphi Graphic Tutorials

#21

pruned_45804299
pruned_45804299
    Offline
    0
    Rep
    11
    Likes

    Member

  • PipPipPip
Posts: 26
Threads: 2
Joined: Dec 28, 2016
Credits: 0
Seven years registered
#21

ijl


  • 0

#22

sedehmate01
sedehmate01
    Offline
    0
    Rep
    0
    Likes

    Lurker

Posts: 4
Threads: 0
Joined: Jan 11, 2017
Credits: 0
Seven years registered
#22

thanks


  • 0

#23

ignore
ignore
    Offline
    0
    Rep
    3
    Likes

    Junkie

  • PipPipPipPipPipPip
Posts: 292
Threads: 0
Joined: Sep 08, 2015
Credits: 0
Eight years registered
#23

'


  • 0

#24

mierdita1
mierdita1
    Offline
    0
    Rep
    0
    Likes

    Lurker

Posts: 7
Threads: 0
Joined: Feb 11, 2017
Credits: 0
Seven years registered
#24

ty

 


  • 0

#25

pruned_80587530
pruned_80587530
    Offline
    0
    Rep
    0
    Likes

    Lurker

  • Pip
Posts: 5
Threads: 0
Joined: May 24, 2017
Credits: 0
Six years registered
#25
Thala

  • 0

#26

JamesUnkilled
JamesUnkilled
    Offline
    -4
    Rep
    21
    Likes

    Developer

Posts: 171
Threads: 10
Joined: Oct 05, 2017
Credits: 0
Six years registered
#26

thanks for sharedbrò!


  • 0

#27

Stengs
Stengs
    Offline
    0
    Rep
    0
    Likes

    Member

  • PipPipPip
Posts: 48
Threads: 0
Joined: Dec 24, 2017
Credits: 0
Six years registered
#27

Thanks a lot  :)


  • 0

#28

0x72
0x72
    Offline
    100
    Rep
    381
    Likes

    Moneymatch me

  • PipPipPipPipPipPipPip
Posts: 1162
Threads: 316
Joined: Dec 29, 2016
Credits: 0

Seven years registered
#28

 

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:
 
Hidden Content
You'll be able to see the hidden content once you reply to this topic or

Please Login or Register to see this Hidden Content

.
 
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 :
 
Hidden Content
You'll be able to see the hidden content once you reply to this topic or

Please Login or Register to see this Hidden Content

.
 
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 to
 
notice the difference between :
 
Hidden Content
You'll be able to see the hidden content once you reply to this topic or

Please Login or Register to see this Hidden Content

.

 

and:

 

Hidden Content
You'll be able to see the hidden content once you reply to this topic or

Please Login or Register to see this Hidden Content

.

 

 
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:
 
Hidden Content
You'll be able to see the hidden content once you reply to this topic or

Please Login or Register to see this Hidden Content

.
 
 
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 


  • 0

#29

farok88a
farok88a
    Offline
    0
    Rep
    0
    Likes

    New Member

  • PipPip
Posts: 20
Threads: 0
Joined: Apr 13, 2018
Credits: 0
Six years registered
#29

THX YOU MAN


  • 0

#30

zbird
zbird
    Offline
    0
    Rep
    0
    Likes

    Lurker

  • Pip
Posts: 7
Threads: 0
Joined: Apr 22, 2018
Credits: 0
Five years registered
#30

Thanks!!!


  • 0


 Users browsing this thread: