Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #31898
| From | Martin Gregorie <martin@address-in-sig.invalid> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Image rotation part 2 |
| Date | 2015-06-30 20:04 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <mmusni$m87$1@dont-email.me> (permalink) |
| References | <mmuhle$gp1$1@dont-email.me> <mmulii$b3u$1@dont-email.me> |
On Tue, 30 Jun 2015 14:03:17 -0400, Eric Sosman wrote:
> On 6/30/2015 12:55 PM, Martin Gregorie wrote:
>> [...]I'm again thinking about somehow standing the character string on
>> end by rotating it through 90 degrees. I'm successfully creating a JPG
>> image containing black 10 pt Monospaced text on a LIGHT_GRAY background
>> within a minimal window (20 pixels high and s.length() * (fontsize * 7
>> / 10) wide, whenever I try to rotate it, all I'm getting is a solid
>> black image thats rotated so its longest dimension is now vertical.
>>
>> The code looks like this:
>>
>> BufferedImage im = new BufferedImage(width,
>> height,
>> BufferedImage.TYPE_INT_RGB);
>>
>> // image created in im
>>
>> BufferedImage om = new BufferedImage(height,
>> width,
>> BufferedImage.TYPE_INT_RGB);
>> AffineTransform at = new AffineTransform();
>>
>
> This may be the problem: You're rotating the image a quarter-turn,
> but not moving the origin. I think that means you're rotating the
> "payload" pixels clear out of the area that then fills the destination.
> (Think about a closed door: After rotating it a quarter-turn about its
> hinges, how much of the rotated door remains within the doorframe?)
If I understand correctly that implies a one line change, replacing
at.setToQuadrantRotation(-1);
with
at.setToQuadrantRotation(direction,
new Double(width/2),
new Double(height/2));
which, sadly just produced another solid black image.
Is there a decent tutorial anywhere about using Affine transforms? I'm
pretty much out of my depth when it comes to this sort of thing.
--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Image rotation part 2 Martin Gregorie <martin@address-in-sig.invalid> - 2015-06-30 16:55 +0000
Re: Image rotation part 2 Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-06-30 14:03 -0400
Re: Image rotation part 2 Martin Gregorie <martin@address-in-sig.invalid> - 2015-06-30 20:04 +0000
Re: Image rotation part 2 Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-06-30 16:20 -0400
Re: Image rotation part 2 Martin Gregorie <martin@address-in-sig.invalid> - 2015-06-30 20:52 +0000
Re: Image rotation part 2 e.d.programmer@gmail.com - 2015-06-30 12:07 -0700
Re: Image rotation part 2 Martin Gregorie <martin@address-in-sig.invalid> - 2015-06-30 20:18 +0000
Re: Image rotation part 2 Jeff Higgins <jeff@invalid.invalid> - 2015-06-30 19:04 -0400
Re: Image rotation part 2 Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2015-06-30 16:36 -0700
Re: Image rotation part 2 Jeff Higgins <jeff@invalid.invalid> - 2015-06-30 20:17 -0400
Re: Image rotation part 2 Jeff Higgins <jeff@invalid.invalid> - 2015-06-30 20:09 -0400
Re: Image rotation part 2 e.d.programmer@gmail.com - 2015-07-01 06:06 -0700
Re: Image rotation part 2 FredK <fred.l.kleinschmidt@gmail.com> - 2015-07-01 10:57 -0700
Re: Image rotation part 2 Jeff Higgins <jeff@invalid.invalid> - 2015-07-01 18:13 -0400
Re: Image rotation part 2 Arne Vajhøj <arne@vajhoej.dk> - 2015-07-27 22:28 -0400
Re: Image rotation part 2 e.d.programmer@gmail.com - 2015-07-28 04:58 -0700
Re: Image rotation part 2 Arne Vajhøj <arne@vajhoej.dk> - 2015-07-28 18:58 -0400
Re: Image rotation part 2 e.d.programmer@gmail.com - 2015-07-29 05:35 -0700
csiph-web