Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 11-13-2004, 01:10 AM   #1 (permalink)
freesoft_2000
Code Monkey
 
Join Date: Oct 2004
Posts: 51
freesoft_2000 is on a distinguished road
Question Rotation

Hi everyone,

I am trying to rotate a jpeg image but it seems that the image gets clipped and there seems to be an ugly black rectangle drawn behind the image after it has been rotated by me. I am really not very sure what i am doind wrong.

Here is the function that is responsible for the image rotation

public BufferedImage imagerotate(BufferedImage SourceImage3, double Degrees1)
{
AffineTransform AT1 = new AffineTransform();
BufferedImage Image5;
int width, height;
double Radians1;
Radians1 = Math.toRadians(Degrees1);
width = (int)(SourceImage3.getWidth());
height = (int)(SourceImage3.getHeight());
Image5 = new BufferedImage(width, height, SourceImage3.getType());
Graphics2D g2 = (Graphics2D)Image5.getGraphics();
AT1.rotate(Radians1);
g2.drawImage(SourceImage3, AT1, null);
return Image5;
}

What i need is for the image not to clipped in anyway and there not to be an ugly black rectangle behind the image after the rotation has taken place.

I hope someone can help me with this

Thank You

Yours Sincerely

Richard West
freesoft_2000 is offline   Reply With Quote
Old 11-13-2004, 04:19 AM   #2 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,174
Belisarius is on a distinguished road
Sorry, I don't think there are many people here that work with graphics in Java. You might want to try the Java boards over at java.sun.com
__________________
GitS
Belisarius is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 01:46 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting