Basic principles of 2d graphics
Download
1 / 44

Basic Principles of 2D Graphics - PowerPoint PPT Presentation


  • 89 Views
  • Uploaded on

Basic Principles of 2D Graphics. Raster Graphics. aka pixel or pixel-oriented graphics. Colors are assigned to each pixel. Used for computer monitors, printers, and file formats like bitmap or jpg All geometrical shapes must be converted to pixels Leads to high computational efforts

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Basic Principles of 2D Graphics' - george-allison


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

Raster graphics
Raster Graphics

  • aka pixel or pixel-oriented graphics.

  • Colors are assigned to each pixel.

  • Used for computer monitors, printers, and file formats like bitmap or jpg

  • All geometrical shapes must be converted to pixels

    • Leads to high computational efforts

    • Possible aliasing effects (aka jaggies)

    • Bound to specific resolution


Vector graphics
Vector Graphics

  • Efficient storage

  • Scalable


Simplejava2dexample
SimpleJava2DExample

  • Code necessary:

    • SimpleJave2DExample

    • MyFinishWindow


Window coordinates
Window Coordinates

  • To find the exact width of the margins (usually this is not necessary, but the ability is available)

    Insets ins = this.getInsets();

    This statement places the width of the left, right, upper, and lower margin in pixels and can be retrieved by:

    ins.left, ins.right, ins.top, and ins.bottom.


Drawing
Drawing

  • In Java2D, you first define your objects. However, none of them will appear on the screen until they are either drawn or filled.


2d rendering process
2D Rendering Process

  • Simple 2D Graphics programs can be outlined as follows:

    • Construct 2D Objects

    • Apply transformations on those objects

    • Apply color and other rendering properties

    • Render the scene on a graphics device


2d geometry
2D Geometry

  • 2D Geometric objects are made up of an infinite number of points in a plane.

  • They can be represented efficiently through geometric equations or parametric equations that describe the objects


Shapes
Shapes

  • Object implement the “Shape” interface with a draw and fill method.

  • Useful facts and examples: http://www.apl.jhu.edu/~hall/java/Java2D-Tutorial.html#Java2D-Tutorial-Shapes


Curvedemo java
CurveDemo.java

  • For an example of how to create curves in Java2D, click here.


Generalpath
GeneralPath

  • Car Example Code


ad