View previous topic :: View next topic |
Author |
Message |
EKruck
Joined: 09 Jan 2010 Posts: 224 Location: Aalen, Germany
|
Posted: Sun Sep 28, 2014 2:45 pm Post subject: Size of %gr graphics areas |
|
|
When I create my %gr window, the variables iSizeX and iSizeY are identical to provide a square.
Code: | MA = WINIO@ ('%pv%^gr[user_resize,full_mouse_input,rgb_colours]&', iSizeX, iSizeY, DrawOnScreen) |
However, when I resize the window, the graphics area is not a square anymore.
Code: |
iSizeX = Clearwin_Info@ ('GRAPHICS_WIDTH')
iSizeY = Clearwin_Info@ ('GRAPHICS_DEPTH')
iSizeX = MIN (iSizeX, iSizeY)
iSizeY = iSizeX |
This provides the values of a squared image, but the graphics area does not reduce it's size. I have tried several functions to update this new smaller size to the %gr area, but I had up to now no success.
Erwin |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Sun Sep 28, 2014 3:22 pm Post subject: |
|
|
There is a new %gr option [keep_aspect_ratio] that works with [metafile_resize] but not (at the moment) with [user_resize].
I would try using %lc after %gr to give the Window handle of the graphics area.
Then use this handle in call resize_window@ within your resizing callback function. Use your adjusted dimensions in this call. |
|
Back to top |
|
|
EKruck
Joined: 09 Jan 2010 Posts: 224 Location: Aalen, Germany
|
Posted: Mon Sep 29, 2014 9:27 am Post subject: |
|
|
That works fine.
Thank you. |
|
Back to top |
|
|
|