This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Building Blockchain Apps and have Michael Yuan on-line!
See this thread for details.
Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

how to save text as gif ?

 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

How could i save text i typed into a textArea as a gif.

Fisrt:
Imagine your typed up a report and saved it as a text file (.txt)
or you wrote and saved a java file (.java)

Now:
Imagine you wanted to open this file?
I want to view my file as a thumb gif and scroll into it, as the image gets big enough, it the reverts back to a (.txt file)

How can i capture the text image?
what option is more do-able:
1. capture the image when it is in a text area.(how do i do this)
2. convert the .txt file to a gif.(is this possible)
 
Ranch Hand
Posts: 472
Objective C Ubuntu Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look in javax.imageio.*. You can capture your UI as an image and then store in formats like gif or png.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you actually don't want to create a gif, but you want have it painted at a screen at a different "zoom level"?

So wouldn't it suffice to paint the text area on the screen using a Graphics object with an appropriate AffineTransformation applied?

Moving to our Swing forum...
 
jite eghagha
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks,

i'll work on those thoughts.
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not really Swing, but I created a command line app to convert a text file into multiple .jpg (or .gif) for viewing on a Sony PSP. A cludged eBook reader :

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's some basic code I have used for option 1:


[ December 11, 2006: Message edited by: Scott Florez ]
 
Tick check! Okay, I guess that was just an itch. Oh wait! Just a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!