Loading in 5 sec....

Basic Principles of 2D GraphicsPowerPoint Presentation

Basic Principles of 2D Graphics

- 89 Views
- Uploaded on

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

- 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

- Efficient storage
- Scalable

SimpleJava2DExample

- Code necessary:
- SimpleJave2DExample
- MyFinishWindow

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

- 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

- 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 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

- 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

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

GeneralPath

- Car Example Code

Download Presentation

Connecting to Server..