Wimp question

Tony van der Hoff tony at mk-net.demon.co.uk
Wed Aug 1 12:13:38 BST 2001


On 1 Aug 2001, in message <4aa328b087sbellon at sbellon.de>,
Stefan Bellon <sbellon at sbellon.de> wrote:

> Hi!
> 
> Currently I'm displaying a JPEG in a simple window which works very
> well. But on a mode change that modifies the xeig and/or yeig values,
> the window is double or half the size in any or both directions.
> 
> Therefore whenever I get message_MODE_CHANGE I do the following:
> 
>   wimp_close_window(mainwin);
>   wopen->visible.x1 = wopen->visible.x0 + (1 << xeig) * width;
>   wopen->visible.y1 = wopen->visible.y0 + (1 << yeig) * height;
>   extent.x0 = 0;
>   extent.y0 = 0;
>   extent.x1 = (1 << xeig) * width;
>   extent.y1 = (1 << yeig) * height;
>   wimp_set_extent(mainwin, &extent);
>   wimp_open_window(wopen);
> 
> Where mainwin is the handle of the window (type wimp_w), extent is of
> type os_box and wopen is a pointer to a wimp_open structure.
> 
> What am I missing?
> 
Did you mean to send this to the OSLib list? I would have thought c.s.a.p.
would be a better forum. 

However, I'll try to help. You don't actually say what your problem is, but
it looks to me that you've forgotten that in win coords, the top left is 0,0,
with the y coord going negative down the screen, so you should be doing:

extent.y1 = 0;
extent.y0 = -(1 << yeig) * height

-- 
Tony van der Hoff         | MailTo:tony at mk-net.demon.co.uk
                          | MailTo:avanderhoff at iee.org
Buckinghamshire, England  | http:www.mk-net.demon.co.uk



More information about the oslib-user mailing list