how to Display a gif image on editor [message #210459] |
Tue, 28 February 2006 12:27 |
Eclipse User |
|
|
|
Originally posted by: spike.m.yahoo.com
Hi Iam trying to display a "gif" image on editor whenever the user clicks
on the Particular Item on the palette.
But the image is not getting loaded , though the image is present in the
icon folder of my project
protected void paintFigure(Graphics g) {
super.paintFigure(g);
Rectangle r = getBounds();
Device dev = new Display();
Image img = new
Image(dev,getClass().getResourceAsStream("/icons/Start.gif"));
g.drawImage(img, r.x, r.y);
}
Any Suggestions or ideas are welcome.
|
|
|
Re: how to Display a gif image on editor [message #210942 is a reply to message #210459] |
Tue, 07 March 2006 11:15 |
Eclipse User |
|
|
|
Originally posted by: ingo.koch[nospam].sap.com
btw:
the paintFigure method is called quite frequently,
so it is a very bad idea to instantiate a new Image each time...(memory
consumption, image has to be disposed)
"Andreas Schosser" <andreas.schosser@mind8.com> wrote in message
news:op.s5or3tjephmt0r@helsinki...
> - do not call the Figure class's paintFigure(Graphics g) method
> - device has no use here either
>
> protected void paintFigure(Graphics g) {
>
> //super.paintFigure(g);
> Rectangle r = getBounds();
> //Device dev = new Display();
> Image img = new
> Image(dev,getClass().getResourceAsStream("/icons/Start.gif"));
>
> g.drawImage(img, r.x, r.y);
> }
>
> kind regards,
>
> --
> Andreas Schosser
> Mind8 GmbH
|
|
|
Powered by
FUDForum. Page generated in 0.04550 seconds