Silverfrost Forums

Welcome to our forums

Size of %gr graphics areas

28 Sep 2014 1:45 #14731

When I create my %gr window, the variables iSizeX and iSizeY are identical to provide a square.

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.

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

28 Sep 2014 2:22 #14732

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.

29 Sep 2014 8:27 #14740

That works fine. Thank you.

Please login to reply.