Home » Desktop Java » awt (page 2)

awt

Scaling Shearing Translating and Rotating a Buffered Image

With this example we shall show you four fundamental graphical transformations that you should know when you try to construct you own custom graphical environment or develop simple graphics. In short in order to perform Scaling, Shearing, Translation and Rotation to a Buffered Image one should take the following steps: Load an image from a source using Toolkit.getDefaultToolkit().getImage method Use an ImageObserver ...

Read More »

Get and set pixels on a Buffered Image

In this tutorial we are going to show you how to set and get the RGB value of each pixel of a Buffered Image. This is particularly useful when you want to perform several operation on images based on the RGB values of each individual image. Or if you want your UI to interact in some way according to the values of the ...

Read More »

Drawing on a Buffered Image

In this tutorial we are going to show you how to Draw on a Buffered Image. This is quite useful when you want to further customize the graphics of your application, if you are not pleased with the original Image. In short in order to Draw on a Buffered Image one should take the following steps: Load an image from a ...

Read More »

Java: Create BufferedImage from Image example

In this tutorial we are going to show you how to create a Buffered Image from a source Image. This is a basic operation if you want to perform several enchantments and transformations to your Image and its fundamental for Image processing. In short, in order to create a BufferedImage from Image one should take the following steps: Load an image from ...

Read More »

Swapping the RGB Values of an Image

With this tutorial we shall show you how to swap RGB values in an Image. This is very useful when you are trying to create some effects to your Application. Basically all you have to do in order to swapp RGD values of an Image is: Load an image using ImageIcon and getImage method Create a class that extends RGBImageFilter and ...

Read More »

Determine if an image has transparent pixels

In this tutorial we shall show you how to check if an Image has transparent pixels. This example shows the basic techniques in order to gain very detailed information about your images. In short,  to determine if an image has transparent  pixels, one has to take the following steps: Load an image using ImageIcon and getImage method If the Image is a BufferedImage the color model is ...

Read More »

Scaling Shearing Translating Rotating a Shape

With this example will shall show you four fundamental graphical transformations that you should know when you try to construct you own custom graphical environment or develop simple graphics. In short in order to perform Scaling, Shearing, Translation and Rotation to a simple shape, one should take the following steps: Use RoundRectangle2D to construct a simple rectangle shape Use AffineTransform class and its ...

Read More »

Create a shape from lines and curves

With this tutorial we shall show you how to swap RGB values in an Image. This is very useful when you are trying to create some effects to your Application. Basically all you have to do in order to swapp RGD values of an Image is: Create a GeneralPath class instance Use moveTo, lineTo, quadTo, curveTo and closePath to draw ...

Read More »

Combining shapes example

In this tutorial we shall show you how to create a simple graphic by combining basic shapes. We are going to use some the built in classes that Java offers. Basically to create and combine shapes in Java: Use Line2D, Ellipse2D, Rectangle2D, RoundRectangle2D, Arc2D, Area to create some simple shapes Use add, subtract, intersect, exclusiveOr methods of the Area class ...

Read More »

Creating basic shapes example

In this tutorial we shall show you how to construct a simple graphic by creating basic shapes. We are going to use some the built in classes that Java offers. Basically to create simple shapes in Java: Use Line2D, Ellipse2D, Rectangle2D, RoundRectangle2D, Arc2D, Area to create some simple shapes Then use Graphics2D class and its draw function ton paint each shape an a new Frame. Let’s see how the ...

Read More »