Image in the center

Hello,
I am trying to build a full screen slideshow but i cant print the
image in the center of the screen.
Could anyone help please??

thanks you
Simon

Hi,

When you blit the picture onto the screen use something like this for
the x and y locations,
x = screen->w / 2 - pic->w / 2
y = screen->h / 2 - pic->h / 2

Where ‘screen’ is your screen surface, and ‘pic’ is your picture surface.

Hope that answers your question.On Tue, 7 Dec 2004 01:53:42 +0100, Simon HEBBO <simon.hebbo at gmail.com> wrote:

Hello,
I am trying to build a full screen slideshow but i cant print the
image in the center of the screen.
Could anyone help please??

thanks you
Simon


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

x = screen->w / 2 - pic->w / 2
y = screen->h / 2 - pic->h / 2

Simplified:
x = (screen->w - pic->w) / 2
y = (screen->h - pic->h) / 2–
Lucas Clemente Vella
@Lucas_Clemente_Vella