Image resizing

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Image resizing

Werner Thie
Hi all

I'm stumped, cant wrap my head around this:

http://tinyurl.com/hxlpkll

I expected the image to grow to the size of the framer container, but
instead the framer is sized down to the image.

Is it possible to achieve such a setup where the contained image is
resized without resorting to resize listeners doing setHeight/setWidth
calls?

As a side note, why does the log show the warning

ImageLoader: Not recognized format of external image
'http://fabricjs.com/assets/17.svg'!

as svg seems to be a recognized image format which the browsers
understand quite nicely

I'm grateful for any hint!

Thxs, Werner

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Image resizing

slah
Hello,
changed Layout from Grow to HBox and adding an appearOnce listener to framer, gives this:
http://tinyurl.com/hsj38c6

hope it helps
Reply | Threaded
Open this post in threaded view
|

Re: Image resizing

Werner Thie
Thank you so much, but the idea is to have the SVG maxing the drawing
area like other elements do without resorting to listeners.

What irks me is the problem, that an image in a container imposes on its
parent, which is contrary to the behavior of other elements, as it can
be easily seen by adding a button or a text area instead of an image.

http://tinyurl.com/zvmnxuy

I faintly remember when I believe it was thron revamped the image class
slightly that such a feat would be possible. I wouldn't mind having two
distinct Image classes available, one with the old behavior and the
other one behaving as a 'normal' container.

Werner

On 4/22/16 12:14 AM, slah wrote:

> Hello,
> changed Layout from Grow to HBox and adding an appearOnce listener to
> framer, gives this:
> http://tinyurl.com/hsj38c6
>
> hope it helps
>
>
>
> --
> View this message in context: http://qooxdoo.678.n2.nabble.com/Image-resizing-tp7588283p7588284.html
> Sent from the qooxdoo mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Image resizing - solved

Werner Thie
On 4/22/16 7:33 AM, Werner Thie wrote:

> Thank you so much, but the idea is to have the SVG maxing the drawing
> area like other elements do without resorting to listeners.
>
> What irks me is the problem, that an image in a container imposes on its
> parent, which is contrary to the behavior of other elements, as it can
> be easily seen by adding a button or a text area instead of an image.
>
> http://tinyurl.com/zvmnxuy
>
> I faintly remember when I believe it was thron revamped the image class
> slightly that such a feat would be possible. I wouldn't mind having two
> distinct Image classes available, one with the old behavior and the
> other one behaving as a 'normal' container.
>
> Werner

Answering my own post for the sake of completeness:

http://tinyurl.com/zwp9zj4

I decided to dig into the layout code and found my solution:

- the imposing part is handled by straddling the _computeSizeHint() function

- the resizing part then is handled by the renderLayout() function,
which simply sets the child size to the available width/height. The SVG
image retains its aspect ratio, leading to a nicely scaling image in the
drawing area.

Thxs for listening, Werner



------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Image resizing - solved

Tom Saddul
This post has NOT been accepted by the mailing list yet.
Thanks for sharing your solution...