Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » how to Display a gif image on editor
how to Display a gif image on editor [message #210459] Tue, 28 February 2006 12:27 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:Realtime scrolling
Next Topic:Adding PaletteContainer to another PaletteContainer ...
Goto Forum:
  


Current Time: Thu Apr 25 01:11:42 GMT 2024

Powered by FUDForum. Page generated in 0.02764 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top