473,320 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

ImagingOpException with Affinetransform

9
Hello,

I'm extending a GUI for marking up images with a zoom feature. I got the graphics transformed by applying an Affinetransform to the graphics object like so in the paintComponent method:

AffineTransform transform = new AffineTransform();
g2d.setTransform(transform);

This worked ok and scaled the images but when I tried to use the marking tool to draw polygons around the items of interest the mouse click points were also translated and weren't the actual points that the user clicked.

So I've been trying to only scale the image with the transform and not the rest of the things being drawn with the following code :

AffineTransform transform = new AffineTransform();
op = new AffineTransformOp(transform, AffineTransformOp.TYPE_BILINEAR);
scaledImage = op.filter(scaledImage, null);

This gives me an ImagingOpException because it cant transform the source image.

scaledImage is a BufferedImage that has been transformed from an Image using the code I found here.

The conversion to a bufferedImage seems to go without any errors and the image is drawn initially. The problem comes at the line of code where I apply the filter.

This is really doing my head in, I'm fairly new to Java Swing so it's probably something stupid on my part.

Sorry for the long post, i would hugely appreciate any tips or advice :)

Thank you
Jun 18 '07 #1
0 987

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Amey Samant | last post by:
hi all i need to draw a string diagonally on an applet. the scenario is like .... i'm writing a game, when a player wins ....i'd like to draw string diagonally on the board saying XYZ wins the...
0
by: mike | last post by:
I would greatly appreciate any help you can give. I have a PlanarImage that I need to rotate. When I try to use the AffineTransformOp, I get a java.awt.image.ImagingOpException. This was my...
0
by: news.skynet.be | last post by:
Hello. I am a beginner at this Java stuff, so bear with me. I have been writing an imaging application as a way of learning Java. I have got little bits working and tied them together in an...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
3
by: k | last post by:
Hi, I'm trying to migrate from Java to C# and have encountered a problem. I can't seem to find a way to create (ultra)condensed fonts for later use in a program. In Java I had a really nice...
2
by: blkcygnus | last post by:
im trying to learn simple image processing-but i cant even get the thing to draw onscreen! heres the code import java.awt.*; import java.awt.geom.*; import java.awt.image.*; import...
7
by: Gotejjeken | last post by:
I have an image stored in a database using a byte. Now, when I read it from the database I'd like to resize it to a certain size so I can avoid having to smash it using HTML. Does anyone know...
1
by: blackraven1425 | last post by:
I;m trying to scale an image (using the imgae's getScaledInstance method) before passing it to an ImageIcon, but it looks like the images are cropped. Has anyone had this problem before? Might it...
2
by: drsmooth | last post by:
Hi, i have made several different things using a double buffer and a jframe before but never had this problem: if you look thrugh the code, you can see that i draw a whole bunch of stuff to the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.