zoom & pictures [message #220382] |
Mon, 31 July 2006 08:55 |
Eclipse User |
|
|
|
Originally posted by: osipov.appliedtech.ru
Hi everybody!
I've got a question for you pals.
I have a gef editor. Everything is fine apart from one thing.
Some figures are drawn in editor using pictures like these:
protected void outlineShape(Graphics graphics)
{
Rectangle bounds = getBounds().getCopy();
if (m_image != null)
graphics.drawImage(m_image, bounds.x, bounds.y);
}
When zoom come into play I am zooming those pictures on my own, i.e.
increasing resolution of my pictures, but GEF tries to do the same, which I
don' want to happen because these results into double zooming so to speak.
How do I avoid that?
Thanks a lot in advance for your help.
|
|
|
Re: zoom & pictures [message #220443 is a reply to message #220382] |
Mon, 31 July 2006 17:36 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
How to avoid the double zooming? Not zoom it on your own.
BTW, you don't need to copy the bounds in your outlineShape() method, since
you're not modifying them.
"Peter Osipov" <osipov@appliedtech.ru> wrote in message
news:eakgim$pmv$1@utils.eclipse.org...
> Hi everybody!
> I've got a question for you pals.
> I have a gef editor. Everything is fine apart from one thing.
> Some figures are drawn in editor using pictures like these:
>
> protected void outlineShape(Graphics graphics)
> {
> Rectangle bounds = getBounds().getCopy();
> if (m_image != null)
> graphics.drawImage(m_image, bounds.x, bounds.y);
> }
> When zoom come into play I am zooming those pictures on my own, i.e.
> increasing resolution of my pictures, but GEF tries to do the same, which
> I
> don' want to happen because these results into double zooming so to speak.
> How do I avoid that?
> Thanks a lot in advance for your help.
>
>
|
|
|
Re: zoom & pictures [message #220505 is a reply to message #220443] |
Tue, 01 August 2006 05:55 |
Eclipse User |
|
|
|
Originally posted by: osipov.appliedtech.ru
Hi, Pratik
Thanks again for your answer.
> How to avoid the double zooming? Not zoom it on your own.
I thought maybe a good solution is not to changed the size of the picture
but just change its resolution? What do you think?
> BTW, you don't need to copy the bounds in your outlineShape() method,
since
> you're not modifying them.
>
> "Peter Osipov" <osipov@appliedtech.ru> wrote in message
> news:eakgim$pmv$1@utils.eclipse.org...
> > Hi everybody!
> > I've got a question for you pals.
> > I have a gef editor. Everything is fine apart from one thing.
> > Some figures are drawn in editor using pictures like these:
> >
> > protected void outlineShape(Graphics graphics)
> > {
> > Rectangle bounds = getBounds().getCopy();
> > if (m_image != null)
> > graphics.drawImage(m_image, bounds.x, bounds.y);
> > }
> > When zoom come into play I am zooming those pictures on my own, i.e.
> > increasing resolution of my pictures, but GEF tries to do the same,
which
> > I
> > don' want to happen because these results into double zooming so to
speak.
> > How do I avoid that?
> > Thanks a lot in advance for your help.
> >
> >
>
>
|
|
|
Re: zoom & pictures [message #220521 is a reply to message #220505] |
Tue, 01 August 2006 16:19 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
It's not exactly clear to me what you're trying to do. If you think the
image is too grainy when zooming, you can definitely switch to an image with
a different resolution. To do that, just listen for changes to zoom and
switch out the image being used. The next paint invocation will then draw
the new image. However, as zooming occurs, the amount of space this image
takes up on the screen definitely needs to grow and shrink. And that is
handled internally by ScaledGraphics. So, you should always just keep
drawing the image to fill up the bounds of its figure.
"Peter Osipov" <osipov@appliedtech.ru> wrote in message
news:eamqc9$43u$1@utils.eclipse.org...
> Hi, Pratik
> Thanks again for your answer.
>> How to avoid the double zooming? Not zoom it on your own.
> I thought maybe a good solution is not to changed the size of the picture
> but just change its resolution? What do you think?
>
>> BTW, you don't need to copy the bounds in your outlineShape() method,
> since
>> you're not modifying them.
>>
>> "Peter Osipov" <osipov@appliedtech.ru> wrote in message
>> news:eakgim$pmv$1@utils.eclipse.org...
>> > Hi everybody!
>> > I've got a question for you pals.
>> > I have a gef editor. Everything is fine apart from one thing.
>> > Some figures are drawn in editor using pictures like these:
>> >
>> > protected void outlineShape(Graphics graphics)
>> > {
>> > Rectangle bounds = getBounds().getCopy();
>> > if (m_image != null)
>> > graphics.drawImage(m_image, bounds.x, bounds.y);
>> > }
>> > When zoom come into play I am zooming those pictures on my own, i.e.
>> > increasing resolution of my pictures, but GEF tries to do the same,
> which
>> > I
>> > don' want to happen because these results into double zooming so to
> speak.
>> > How do I avoid that?
>> > Thanks a lot in advance for your help.
>> >
>> >
>>
>>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03426 seconds