Resizing an ImagePresenter?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Resizing an ImagePresenter?

John Clonts
"   Open the file bill.jpg in a window.  
    Let the dimensions of the window client area be the
    dimensions of the jpg image."

image := (OLEPicture fromFile: 'c:\windows\desktop\bill.jpg').

image extent.  "460@720"

presenter := ImagePresenter showOn: image.  "displays, but too big"

presenter view extent.    "674@485"

presenter view extent: 460@720.

presenter view extent.   "still 674@485 (?)"

Why does this not work as I expect? Or, how should I achieve what I am
seeking?



Thanks,
John


Reply | Threaded
Open this post in threaded view
|

Re: Resizing an ImagePresenter?

Ian Bartholomew
John,

"John Clonts" <[hidden email]> wrote in message
news:[hidden email]...

> Why does this not work as I expect? Or, how should I achieve what I am
> seeking?

To enable the ImagePresenter to be displayed outside of it's normal
environment (embedded in a ContainerView of some sort) Dolphin is
automatically wrapping it in a ShellView and _this is the view that needs
resizing. Try -

image := (OLEPicture fromFile: 'c:\windows\desktop\bill.jpg').
presenter := ImagePresenter showOn: image.
presenter view topView extent: image extent

Ian


Reply | Threaded
Open this post in threaded view
|

Re: Resizing an ImagePresenter?

John Clonts
Ian Bartholomew wrote:

>
> John,
>
> "John Clonts" <[hidden email]> wrote in message
> news:[hidden email]...
>
> > Why does this not work as I expect? Or, how should I achieve what I am
> > seeking?
>
> To enable the ImagePresenter to be displayed outside of it's normal
> environment (embedded in a ContainerView of some sort) Dolphin is
> automatically wrapping it in a ShellView and _this is the view that needs
> resizing. Try -
>
> image := (OLEPicture fromFile: 'c:\windows\desktop\bill.jpg').
> presenter := ImagePresenter showOn: image.
> presenter view topView extent: image extent
>
> Ian

Perfect!  Thanks!

Cheers,
John