• 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
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

linux server load an image from file

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello every body.
My server is linux server(doesn't have x windows)My servlet needs to create an image(offscreen buffered image) and draw images on it reading from the files on the server.
but drawImage always returns false inspite of using mediatracker. and the images from file are never drawn.
this is the code
can some one please help me.
*******************
s="/home/admin/davs/bug.gif";
Toolkit toolkit = Toolkit.getDefaultToolkit();
ImageIcon icon = new ImageIcon(s);
img = icon.getImage();
Container c=new Container();
MediaTracker mt=new MediaTracker(c);
mt.addImage(img ,0);
try{
mt.waitForAll();
}catch(Exception ex){ex.printStackTrace();}
bool=g.drawImage(img,30, 30,c);
*******************
how ever i try with or with out mediatracker i always get bool as false.
can some one plaesae help me.........
thanks in advance
[ September 23, 2002: Message edited by: sunitha singh ]
 
Author
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i'm pretty sure you have to have an x server running, even if it is in the background. YOu dont have to run a client or anything but there must be a server.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic