Skip to content
Advertisement

Tag: image

Java fade in and out of images

I am trying to learn how to fade in and out images into another image or from another image. So, if I have 2 images, and 1 is being displayed at the moment, I want to display another image in the background and fade the first image out into the 2nd image. OR, I want to set the focus on

JFrame Image, paint on top of it

I create a frame with an image with this code: That works fine, but now I want to paint something in that opened frame (on top of the image). I’m quite new in Java, and I’ve allready tried to make a class that extends JFrame, with a paint(Graphics g) method in it, but it wouldn’t work, I only see the

Watermarking with PDFBox

I am trying to add a watermark to a PDF specifically with PDFBox. I’ve been able to get the image to appear on each page, but it loses the background transparency because it appears as though PDJpeg converts it to a JPG. Perhaps there’s a way to do it using PDXObjectImage. Here is what I have written thus far: Answer

Java: Rotating Images

I need to be able to rotate images individually(in java). The only thing I have found so far is g2d.drawImage(image, affinetransform, ImageObserver ). Unfortunately, I need to draw the image at a specific point, and there is no method with an argument that 1.rotates the image separately and 2. allows me to set the x and y. any help is

Java: Filling a BufferedImage with transparent pixels

I have an off-screen BufferedImage, constructed with the type BufferedImage.TYPE_INT_ARGB. It can contain anything, and I’m looking for a way to (fairly efficiently) completely overwrite the image with transparent pixels, resulting in an ‘invisible’ image. Using something like this: Has no effect. One possible method might be just to write over every pixel in the BufferedImage, but I’m not sure

How to scale a BufferedImage

Following the javadocs, I have tried to scale a BufferedImage without success here is my code: I can’t understand why it is not working, any help? Answer AffineTransformOp offers the additional flexibility of choosing the interpolation type. The fragment shown illustrates resampling, not cropping; this related answer addresses the issue; some related examples are examined here.

Advertisement