• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

how to display an image using drawImage()

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have successfully displayed image using the below method
Image img = ImageIO.read(new File("F:\\x.jpg"));
g2.drawImage(img,,,,,);

my question is, i am reading an image from database and i want to display that particular image using drawImage() method

here is the code how am retrieving image from database and storing on hard disk
byte[] fileBytes;
fileBytes = rs.getBytes(2);
while(rs.next())
{
OutputStream targetFile = new FileOutputStream("e:/dp.jpg");
targetFile.write(fileBytes);
}
targetFile.close();

i don't want to store the image on hard disk just i want to display that image using drawImage().
please help me -thanks in advance.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic