aspose file tools*
The moose likes Java in General and the fly likes HELP!!!! how do i get image by extending Canvas object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "HELP!!!! how do i get image by extending Canvas object" Watch "HELP!!!! how do i get image by extending Canvas object" New topic
Author

HELP!!!! how do i get image by extending Canvas object

Richard Teston
Ranch Hand

Joined: Feb 12, 2002
Posts: 89
help...
i have this code i've extended the canvas object, basically i'm coding my own button by using canvas but how do i get image from a file


The Code is the Programmer
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Richard,
How about:
Image im = Toolkit.getDefaultToolkit().getImage( "C:\\TEMP\file.gif" );
Regards,
Manfred.
Roy Ben Ami
Ranch Hand

Joined: Jan 13, 2002
Posts: 732
also, since you are using canvas i guess you are using AWT and not swing.
if u ecide to switch to swing then u can use the class called ImageIcon. only needs a filename in its constructor.
ImageIcon x=new ImageIcon("file name");
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HELP!!!! how do i get image by extending Canvas object
 
Similar Threads
Image from Canvas
Java Image
how to get Image from Canvas
Getting image using tomcat webserver
Displaying a png on screen using AWT