1 / 10

Line

Line. Attributes (X1, Y1, X2, Y2, Color) The Line Based on Slope Decision on the dx and dy Loop on Greater (Counter of 1) Increment of other (Slope) Plot Pixels in the loop. Line. ‘dx’, ‘dy’ to calculate the diffrence along x and y axis ‘steps’ to calculate Loop counting

raoul
Télécharger la présentation

Line

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Line • Attributes (X1, Y1, X2, Y2, Color) • The Line Based on Slope • Decision on the dx and dy • Loop on Greater (Counter of 1) • Increment of other (Slope) • Plot Pixels in the loop

  2. Line • ‘dx’, ‘dy’ to calculate the diffrence along x and y axis • ‘steps’ to calculate Loop counting • ‘xInc’, ‘yInc’ to calculate the Difference covered in each step • ‘x’ , ‘y’ to store current pixel position • ‘i’ as a loop variable

  3. Line • Calculate ‘dx’ as x2-x1,‘dy’ as y2-y1 • ‘steps’ will have the greater absolute value from ‘dx’ or ‘dy’ • ‘xInc’ is ‘dx’/’steps’ ,‘yInc’ is ‘dy’/’steps’ • ‘x’ is ‘x1’ • ‘y’ is ‘y1’ • Plot 1st pixel at ‘x’,’y’ using ‘color’ • Loop ‘k’ 1 to steps and ‘x’+=‘xInc’, ‘y’+=‘yInc’

  4. Rectangle • Attributes (X1,Y1,X2,Y2,Color) • Set of four Lines • Line 1(X1,Y1,X2,Y1) • Line 2(X1,Y2,X2,Y2) • Line 3(X1,Y1,X1,Y2) • Line 4(X2,Y1,X2,Y2)

  5. Button • Set of 8 Lines • Line 1(X1,Y1,X2,Y1, Silver) • Line 2(X1,Y2,X2,Y2, Black) • Line 3(X1,Y1,X1,Y2,Silver) • Line 4(X2,Y1,X2,Y2, Black) • Line 5(X1+1,Y1+1,X2-1,Y1+1, White) • Line 6(X1+1,Y2-1,X2-1,Y2-1,Gray) • Line 7(X1+1,Y1+1,X1+1,Y2-1,White) • Line 8(X2-1,Y1+1,X2-1,Y2-1, Gray)

  6. PolyGon • n no of Attributes • Set of n/2 no of lines • Filled or Open Shape • Parameters Array, and count of points

  7. Circle • Attributes ( xc, yc, radius, color) • ‘x’, ‘y’ as current points • ‘i’ to run loop 0 to 360 • ‘x’ is calculated as xc+radius*cos(rad) • ‘y’ is calculated as yc+radius*sin(rad) • Where rad is PI*deg/180

  8. Arc • Attributes ( xc, yc, radius,startAngle, endAngle , color) • ‘x’, ‘y’ as current points • ‘i’ to run loop start to end • ‘x’ is calculated as xc+radius*cos(rad) • ‘y’ is calculated as yc+radius*sin(rad) • Where rad is PI*deg/180

  9. Ellipse • Attributes ( xc, yc, Xradius,Yradius, color) • ‘x’, ‘y’ as current points • ‘i’ to run loop 0 to 360 • ‘x’ is calculated as xc+Xradius*cos(rad) • ‘y’ is calculated as yc+Yradius*sin(rad) • Where rad is PI*deg/180

  10. Elliptical Arc • Attributes ( xc, yc, Xradius,Yradius,start, end, color) • ‘x’, ‘y’ as current points • ‘i’ to run loop start to end • ‘x’ is calculated as xc+Xradius*cos(rad) • ‘y’ is calculated as yc+Yradius*sin(rad) • Where rad is PI*deg/180

More Related