SWT equivalent of AWT's getGraphics()? [message #98773] |
Sat, 11 October 2003 18:53  |
Eclipse User |
|
|
|
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 #99084 is a reply to message #98964] |
Sun, 12 October 2003 23:13  |
Eclipse User |
|
|
|
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
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02802 seconds