Y_Paint 0.2 User's Manual

You are presented with the most advanced 0.2 version of the paint program immaginable. It includes the following features:

  • All the requirements of lab 1 have been incorporated into lab 2. In addition to the old figures (Polygon, Line, Circle, Ellipse, Rectangle, Free hand Drawing), the program now also supports Clipped Lines and Clipped Polygons!

  • In order to draw a figure, please select it from the leftmost choice menu. Please note, that clipped figures (Line and Polygon) are separate choices in the menu.

    For lines, rectangles, circles, ellipses, and free-hand drawing, click with the mouse at the initial position on the screen, than drag the mouse to a desired final position. Figures are redrawn in rubber band mode.

    To draw polygons, select them in the menu. Then click on the desired vertices (but don't drag the mouse, since the program expects proper "click" events). After you are finished allocating the vertices, click on the Complete Polygon button that connects the first and the last vertices and allows you to continue with drawing other figures.

    Clipped figures (lines and polygons) are drawn in the same manner as their non-clipped equivalents, except after the figure to be clipped is defined, you must select a clipping retangle (by clicking on a desired vertix, and dragging the mouse and releasing it). The clipping rectangle and the clipped portion of the figure are drawn in "magenta" color.

  • To shange the Grid Size, you should click on the "Grid Size" button. This bring up a dialog window that allows you to specify the desired virtual pixel size in screen coordinates. Please note, that the non-numeric values in the edit boxes will be rejected.

  • To modify the Line Properties, such as Line Thikness and the Anti-Aliased line drawing mode, click on the "Line properties" button. This brings up another dialog box that allows you to spesify those parameters. Please note, however, that "Anti-Aliased" mode draws lines at most 3 pixels wide, due to the nature of the algorithm implemented.

  • The Anti-Aliasing algorithm algorithm implemented uses a derivation of the Gupta-Sproull algorithm. The intensity of the pixels is represented by their color. Basically, I modified the RGB values of the original colors based on how far the pixel is from the ideal center of the line. The further it is, the relatively closer all its components are to '255', thus making the pizel "whiter" and more blened into the white background. This works best for pure colors, such as blue, red, and green, and for various shades of gray.

  • Grid lines start apperaing when both width and height specified are at least 5 real pixels. Please note, that a pixel can be any rectangle, not just a square.

  • Figures "remember" their original color. They are always redrawn in the order they were drawn originally.

  • The total of 7 colors are supported (including the 6 choices of foreground color plus the "magenta" clipping color). Blue is selected as the default color in the beginning. Color can be changed by clicking on the appropriate polygon in the Color Menu, which comes up at the very beginning. Please note, however, that if you change color on the menu while in the process of drawing a complex figure (like polygon), the change will not take effect until you complete this figure and start on a new one.

  • Lines drawn in the program are symmetric, i.e. a line (x1, x2) would appear the same as the line (x2, x1).

  • Rotation was implemented as an additional feature. It rotates figures around the center point specified, by the specified number of degrees, clockwise. It can be used by clicking on the "Rotation" button. The program expects integer values for both the coordinates and the angle.

    Please, note, however, that the rotation of rectangles and ellipses does not appear accurate because we store only two coordinates (diagonal points), while all 4 undergo an independent transformation during rotation. Thus, it only makes sense to rotate rectangles and ellipses by multiples of 90 degrees. All other figures undergo normal rotation.

  • "Clear" button erases all figures from display and memory.


    Enjoy!!!