Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

new image after rotate  RSS feed

 
Jamal Hasanov
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, all

How can I set the background color of rotated image?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vertical text from a Servlet (on the Ranch Radio) is for Servlets, but the background image part is the same.
 
Jamal Hasanov
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think my case is different. I couldn't apply your approach..
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think my case is different.

How is it different?
I couldn't apply your approach.

What does that mean? What did you do and what was the result?
 
Jamal Hasanov
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried to set the background color.. that was the main difference. And you don't use AffineTranformOp - you use subimaging.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But without giving us more details, we have to guess what your problem is.

I think what you are doing is drawing an image to a graphics context, rotating and then trying to change the background, whereas I was creating a context with a background color, writing text and then rotating. The main difference is that I was able to write the text over the background whereas your image completely covers it.

does this sound like we're getting warm?
 
Jamal Hasanov
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I figured out the problem: I should have created BufferedImage with BufferedImage.TYPE_INT_ARGB parameter (Sun Java Forum) . Here's my rotate method:
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for providing an update.
While I have delved into image stuff a few times, it confuses the heck out of me so anything extra helps.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!