Page 1 of 1

Simply displaying an image

PostPosted: Aug 1, 2003 @ 12:07pm
by gchuang
Hi..

From what I have read on all these posts, it seems as if displaying images is done only through CGapiSurface.CreateSurface()...

Is this the function that should be used when displaying several images (png, bmp, etc) on the screen at a time?

A broader question i have... Is a surface something that can be layered on top of other surfaces, resulting in a final image being produced (like layers in photoshop)? Or is the surface itself the final image that is displayed on the screen?

Basically, i'm having trouble just displaying images on the smartphone... im not sure which function to use. the surface class has draw functions for rectangles, lines, and pixels.. how come there's no draw function that places a certain image resource at a certain location? It doesnt really make sense that createSurface is the only way to display an image file...

Any help would be greatly appreciated...
-Gee

PostPosted: Aug 1, 2003 @ 9:29pm
by ppcStudios

PostPosted: Aug 1, 2003 @ 9:31pm
by Guest

PostPosted: Aug 2, 2003 @ 1:20am
by fzammetti
You may want to have a look at:



This is a post that someone else made a few days ago, both ppcStudios and I replied and I think it may clarify things for you a bit as well.

Creating an image

PostPosted: Aug 3, 2003 @ 4:39am
by mlepage
Basically, three steps:

First, create the C++ object that will hold the surface:

CGapiSurface image;

Second, load the image into that C++ object by calling a member function:

image.CreateSurface(0, _T("image.png"));

Now, to actually display the image on the screen, you need to "blit" (copy) it to another surface that represents the screen. For example, if you look in the samples, the application MyApplication has a member function ProcessNextFrame which has a CGapiSurface parameter named backbuffer. If you blit your image to the backbuffer, when ProcessNextFrame exits the backbuffer will be copied to the video screen, and you will see your image.