Skip to main content



      Home
Home » Eclipse Projects » GEF » SWT equivalent of AWT's getGraphics()?
SWT equivalent of AWT's getGraphics()? [message #98773] Sat, 11 October 2003 18:53 Go to next message
Eclipse UserFriend
Originally posted by: murali.bizmarg.com

Hello all,
I am currently converting a routine written in AWT to SWT.

Here is the AWT snippet... (m_buffer is an Image)

public void paint(Graphics graphics)
{
Graphics myGraphics = m_buffer.getGraphics();
super.paint(myGraphics);
doWork(myGraphics);
graphics.drawImage(m_buffer, 0, 0, null);
}

I want to do the same thing in SWT (using draw2D)...

But, how do I get a "org.eclise.draw2d.Graphics" object from an
"org.eclipse.swt.graphics.Image" object?
I am not sure how to translate the "m_buffer.getGraphics()" portion...

Is there an SWT equivalent of AWT's getGraphics()?

Thx.
-M
Re: SWT equivalent of AWT's getGraphics()? [message #98964 is a reply to message #98773] Sun, 12 October 2003 21:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

new GC(canvas)
"Murali" <murali@bizmarg.com> wrote in message
news:oprwwhuprl2xtqbv@news.eclipse.org...
> Hello all,
> I am currently converting a routine written in AWT to SWT.
>
> Here is the AWT snippet... (m_buffer is an Image)
>
> public void paint(Graphics graphics)
> {
> Graphics myGraphics = m_buffer.getGraphics();
> super.paint(myGraphics);
> doWork(myGraphics);
> graphics.drawImage(m_buffer, 0, 0, null);
> }
>
> I want to do the same thing in SWT (using draw2D)...
>
> But, how do I get a "org.eclise.draw2d.Graphics" object from an
> "org.eclipse.swt.graphics.Image" object?
> I am not sure how to translate the "m_buffer.getGraphics()" portion...
>
> Is there an SWT equivalent of AWT's getGraphics()?
>
> Thx.
> -M
Re: SWT equivalent of AWT's getGraphics()? [message #99084 is a reply to message #98964] Sun, 12 October 2003 23:13 Go to previous message
Eclipse UserFriend
Originally posted by: Murali.BizMarg.com

Thx.,
Randy.

"Randy Hudson" <none@us.ibm.com> wrote in message
news:bmd0pe$pmt$1@eclipse.org...
> new GC(canvas)
> "Murali" <murali@bizmarg.com> wrote in message
> news:oprwwhuprl2xtqbv@news.eclipse.org...
> > Hello all,
> > I am currently converting a routine written in AWT to SWT.
> >
> > Here is the AWT snippet... (m_buffer is an Image)
> >
> > public void paint(Graphics graphics)
> > {
> > Graphics myGraphics = m_buffer.getGraphics();
> > super.paint(myGraphics);
> > doWork(myGraphics);
> > graphics.drawImage(m_buffer, 0, 0, null);
> > }
> >
> > I want to do the same thing in SWT (using draw2D)...
> >
> > But, how do I get a "org.eclise.draw2d.Graphics" object from an
> > "org.eclipse.swt.graphics.Image" object?
> > I am not sure how to translate the "m_buffer.getGraphics()" portion...
> >
> > Is there an SWT equivalent of AWT's getGraphics()?
> >
> > Thx.
> > -M
>
>
Previous Topic:Flow Editor
Next Topic:GEF cvs?
Goto Forum:
  


Current Time: Fri May 09 06:54:00 EDT 2025

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

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

Back to the top