How to make a window with scroll bars?

Suppose I have a 1280x1024 image, and want to show it on a 800x600
window, how can I make my window have scroll bars?

Hi,

you are being a bit too vague.

Do you want to do it in plain SDL, with any of the gui libraries or using
OS specific toolkits?

Cheers,
Paulo

Manuel Garc?a Cabrera schrieb:> Suppose I have a 1280x1024 image, and want to show it on a 800x600

window, how can I make my window have scroll bars?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Right now I want to do it as easy as possible… Right now I’m sending a
video over a LAN, and playing it with SDL (actually, I send images over
the LAN and show them with SDL). Well, when the resolution of the sent
images is higher than the resolution of the PC that plays them, I want
the video to play but inside a window that fits the player screen, and
to be able to see the whole image via scrollbars.

What’s the easiest way to do that? I would prefer to do it with plain
SDL, but any other way will do.

Paulo Pinto escribi?:> Hi,

you are being a bit too vague.

Do you want to do it in plain SDL, with any of the gui libraries or using
OS specific toolkits?

Cheers,
Paulo

Manuel Garc?a Cabrera schrieb:

Suppose I have a 1280x1024 image, and want to show it on a 800x600
window, how can I make my window have scroll bars?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Quoting Manuel Garc?a Cabrera :

Right now I want to do it as easy as possible… Right now I’m sending a
video over a LAN, and playing it with SDL (actually, I send images over
the LAN and show them with SDL). Well, when the resolution of the sent
images is higher than the resolution of the PC that plays them, I want
the video to play but inside a window that fits the player screen, and
to be able to see the whole image via scrollbars.

What’s the easiest way to do that? I would prefer to do it with plain
SDL, but any other way will do.

erm… there are a few sdl widget thingy librairies out there, but i
dunno about
them,

perhaps if it just for this you have some arrows that when clicked move the
origin of the image, for scroll bars you’d have to do a rectangle representing
the size of the image on screen and a space represenative of whats unseen and
when dragged move the origin accordingly

or perhaps you could have it so when the mouse is click held anywhere on the
image the user can then move thie image around to see all of it, this
method is
probably a little more user friendly than the user having to navigate scroll
bars and buttons

or… perhaps scale down the image so it fits using SDL_gfx.h

hope that makes sence and might help!