How to use AbstractImageField doRotate(), etc. methods ? [message #1815378] |
Tue, 01 October 2019 17:24  |
Eclipse User |
|
|
|
Hello,
I am trying to use an AbstractImageField to display an image and let the user do some usual display actions, such as a rotation or scaling.
There are apparently useful methods such as doRotate() or doZoom(), setRotateDelta(), etc., however none of them seems to do anything, excepted setAutoFit() which works perfectly.
But when I execute doRotate() or doZoom(), using a menu action, nothing happens.
I use Scout 9.0.
What do I miss ?
Thank you!
|
|
|
|
|
|
Re: How to use AbstractImageField doRotate(), etc. methods ? [message #1815525 is a reply to message #1815490] |
Fri, 04 October 2019 04:04  |
Eclipse User |
|
|
|
Hi Michel
Scout does not draw the canvas itself, instead it uses an <img> tag. Unfortunately, autofit for both landscape and portrait images cannot be accomplished easily in HTML. The .autofit CSS class we use is somewhat of a "hack", but does work for simple use cases. It may not work with transformed images, though. But you could always try to redefine the .autofit class with better rules. For the scrollbars to work correctly, you probably have to set your transform-origin to "top left".
Depending on your use case, you could apply the image transformations in Java and send a new image to the browser after each change. Here is the code from the old Swing implementation, maybe it is useful to you.
Another option would be to search the internet for a more sophisticated "image drawing and manipulation" widget in JS and then include that external library in Scout (using a custom form field).
Regards,
Beat
|
|
|
Powered by
FUDForum. Page generated in 0.03136 seconds