This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Simply displaying an image


Simply displaying an image

Postby gchuang » Aug 1, 2003 @ 12:07pm

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
gchuang
pm Member
 
Posts: 2
Joined: Jul 30, 2003 @ 12:04pm


Postby ppcStudios » Aug 1, 2003 @ 9:29pm

G.R. Moore
President/CEO
Pocket PC Studios
www.ppcstudios.com

Image
User avatar
ppcStudios
pm Insider
 
Posts: 744
Joined: Aug 23, 2002 @ 3:53pm
Location: Canfield, Ohio


Postby Guest » Aug 1, 2003 @ 9:31pm

Guest
 


Postby fzammetti » Aug 2, 2003 @ 1:20am

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.
...and so I said to Mr. Gates: "$640 billion should be enough for anyone!"
User avatar
fzammetti
pm Insider
 
Posts: 1496
Joined: Jun 4, 2002 @ 6:21pm
Location: Omnytex Technologies


Creating an image

Postby mlepage » Aug 3, 2003 @ 4:39am

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.
mlepage
 


Return to GapiDraw


Sort


Forum Description

The Cross-platform Graphics SDK for Palms, Pocket PCs, Symbian Devices, and Stationary PCs.

Moderators:

sponge, Johan

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum