Documente Academic
Documente Profesional
Documente Cultură
ANDHRA PRADESH
CCP503.52 2
Use of Pset() method of color parameter
All the examples hereon assume a form
with the name Form1 having 5000(X) X
5000(Y) coordinates
Syntax of Pset() with color parameter:
CCP503.52 3
Explanation:
IntX and IntY were already explained.
CCP503.52 4
Explanation of Pset() with color parameter
CCP503.52 5
You can use any of the above values for
color parameter of Pset() method to set
the color of the point to be drawn
CCP503.52 6
Examples of Pset() with color parameter
Examples:
Pset(2500, 2500), vbRed --- sets red color point in form
center
Pset(2600, 2500), vbGreen-- sets Green color point in
form center
Pset(2700, 2500), vbBlue--- sets Blue color point in form
center
Pset(2800, 2500), vbBlack--- sets Black color point in form
center
CCP503.52 7
Can the Background color of the form be any of
the above colors set by Pset() method above?
Fig:1
CCP503.52 8
Explanation Of Step Parameter of
Pset() Method
EXPLANATION:
Step Parameter sets point as offset from
previous point
Syntax of Pset() with step parameter:
Pset step (IntX, IntY)
intX, intY are coordinate points on
form
What are Coordinate points?
CCP503.52 9
Example of Pset() with step parameter
Example:
Form1.Pset(2500,2500), vbRed
Form1.Pset Step(100, 100), vbWhite
Form1.Pset (2500, 2500), vbRed
Form1.Pset Step(100, -100), vbBlue
Form1.Pset (2500, 2500), vbRed
Form1.Pset Step(-100, -100), vbMagenta
Form1.Pset (2500, 2500), vbRed
Form1.Pset Step(-100, 100), vbGreen
Form with 5000 X 5000 Coordinates
CCP503.52 10
Example of Pset() with step
parameter
Fig:2
CCP503.52 11
Pset() with variables and Loops
Explanation:
Variables can be used as intX, intY values so
that they can be changed at runtime.
What is runtime?
CCP503.52 12
Pset() with variables and Loops
Example:
x=inputbox(“Give x value”)
y=inputbox(“Give y value”)
CCP503.52 13
Pset() with Step and loops
Explanation:
Loops, the control structures for iterations,
can be used to repeat a set of dots with step
parameter so that a series of dots can be
drawn from a fixed point
Example:
Pset(2500,2500), VbRed
for I = 1 to 100
Pset step (100,100)
Next I
CCP503.52 14
The first instruction draws a point in the
middle of the form. The loop draws 100
points, each, 100 points away from previous
point diagonally right down
CCP503.52 15
Some More Examples using loops
and variable with Step parameter
Example:
Pset(2500, 2500), VbGreen
For I = 1 to 10
Pset step (100, 0)
next I
The first instruction sets a point at coordinates
2500(x),2500(y).The loop draws 10 dots from
the above point every 100 twips away on the
same line (x-axis) without changing row(Y-axis)
CCP503.52 16
Assignment:
Write programs to draw lines vertically up, vertically
down, horizontally left, diagonally left up, left down,
right up
CCP503.52 17
Summary
We have discussed about:
Dots with color parameter
CCP503.52 18
Quiz – Objective Type
CCP503.52 19
Quiz – Objective Type
and Y coordinate___________.
Decreases
CCP503.52 20
Frequently Asked Question
CCP503.52 21