Posts

Showing posts with the label Graphics 2D API

Coordinate system of java | Graphics2D coordinate system | Razsoft Education

Image
   As we all know java follows WORA(Write Once Run Anywhere) principle. So, in this process it may encounter many different size and type of output devices. To give the same user experience to users across all devices java manages two different coordinate system.     1. User space coordinate system    2. Device space coordinate system 1. User space coordinate system :- It's a device independent coordinate system also called logical coordinate system. Which is used by developers to draw and set elements in application. It's relative to the application. In java to do all the graphical drawing we use this coordinate system.            In user space top left corner is 0,0 position. The x- coordinate goes horizontally from left to right, and y-coordinate moves from top to bottom. And a point is defined by first x - coordinate followed by y- coordinate.  2. Device space coordinate system :- It's a device depend...

Java 2D Rendering Pipeline | Rendering in java | Razsoft Education

Image
What is Rendering?                      When we draw anything on screen, it involves many step by step process to calculate where and how to produce each pixel on screen, These step by step process is known as Rendering Pipeline and process is known as Rendering .      In this process we first define our basic shapes also known as primitives(such as text, image and geometric shapes). Then these primitives' as passed to a rendering engine like Graphics2D, That perform the step by step process of rendering pipeline. Then output image is given to an output device like screen, printer or an image stored in memory.  Apart from rendering engine Graphics2D also work as a surface to draw primitives on it. Each time we draw a new primitive on surface it added on the surface. Which we can draw on a output device.  Graphics2D States :-  Graphics2D work as a state machine to draw the primitives. It...

Graphics2D API an introduction to Java2D | Razsoft Education

Image
            To overcome problems with the Graphics class and to enhance some functionality. Java introduces new class called Graphics2D . Which allows to better control over graphics operations? Also java introduces a whole set of package to do 2D graphics operation including image manipulation , drawing and transformation and the package is backward compatible.                For example Java2D API has separate class for each type of basic shapes. All the shapes implements Shape interface . Also we can define our own shape by implementing shape interface in our own custom shape class.                Control the fill and line style with control on width of the line. The Stroke and Paint interface was introduced to make custom fill and drawing style.         ...

Computer graphics with java an introduction | Razsoft Education

Image
               Graphics is a way to represent visual element in application. Java provided us rich set of methods and class through Java2D API to deal with the graphics in java platform and application. Using AWT methods to draw and manipulated GUI interface.                Java2D comes with rich set of function to manipulate images, text, font, color, etc. It has capability to draw basic geometric shapes and curves. Java media framework allows us to work with media files and create animations. Java media framework depends upon Java2D framework for rendering purposes.                For basic drawing operation every java AWT component which is visible to screen contains a reference to graphics object, which is an object of abstract class Graphics. It comes with many useful methods to draw eleme...

Computer graphics an introduction | Razsoft education

Image
Computer graphics or CG Definition: Computer graphics is a field of computer science in which we study the creation and manipulation of images.   Computer graphics is an art of communicating to computer visually. Application: Movies: -  In movies they use VFX to create many scene like large explosion, plane crash or create entirely new environment like in Avengers and avatar. Cartoons: -  It’s used to create fictional characters and animate them to make animation videos like Doremon, Tom and Jerry and Motu-Patlu.   Video games: -  Video game is industry completely based on computer graphics. It’s used to create environment, character and interaction with them. Some popular computer games are like Vice city, Temple run, PUBG, etc. Simulation: -  Using computer we can describe behavior of object’s in computer then simulate  them in virtual environment to see the effect. It’s also used to teach people about complex machine operation like p...