Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Convert BufferedImage into File object  RSS feed

 
Moayad Abu Jaber
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Rancher,
I tried to convert BufferedImage to File object. I used twain API to acquisition the image. the API return to me the image as BufferedImage. I have barcoder reader API take the Image as File object. I want to put image I acquired from twain API into barcode reader.

I post the scenario to clarified what I want do.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the file should be a JPEG, BMP or PNG then that's easily doable. See examples e695 and e696 here. If you need a GIF or TIFF then it gets a bit more complicated, but not much.
 
Moayad Abu Jaber
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Ulf Dittmer,
The site example haven't example how to convert the BufferedImage object into File object.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An image can't be converted into a File object, but it can be saved in a file. Isn't that what you want to do? You can always create a File object after you have created the file.
 
Moayad Abu Jaber
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Ulf Dittmer,
You are right, thanks for you help
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!