nanogui: GrDrawImageFromFile


Previous by date: 4 Nov 2005 18:20:45 +0000 [PATCH] don't overwrite definitions if already defined in device.h, Alexander Neundorf
Next by date: 4 Nov 2005 18:20:45 +0000 viewml image loading, emaroto.fr.abx.fr
Previous in thread: 4 Nov 2005 18:20:45 +0000 GrDrawImageFromFile, ER
Next in thread:

Subject: Re: GrDrawImageFromFile
From: "Jordan Crouse" ####@####.####
Date: 4 Nov 2005 18:20:45 +0000
Message-Id: <20051104182032.GC30635@cosmic.amd.com>

> I have a pit of confusion when using GrDrawImageFromFile and GrLoadImageFromFile. I've been using the former for some time now but looking for a way to preload some images at the beginning of the app. I would preload them into memory then pull them in as needed. However, the more I read about GrLoadImageFromFile the more I believe it's not possible. Is that correct? Am I missing something? Any suggestions?
 
GrLoadImageFromFile reads the file and decodes it into an image structure,
which then gets drawn at your leisure with GrDrawImagetoFit().

It might help to think of GdDrawImageFromFile as being similar to the
following psuedo-code:

GrDrawImageFromFile(id,gc,x,y,width,height,path,flags)
{
	ID = GrLoadImageFromFile(path, flags);
	GrDrawImageToFit(id, gc, x, y, width, height, ID);
	GrFreeImage(ID);
}

So, you can easily pre-load all your images with GrLoadImageFromFile, and
then draw them when you need.  If you have the memory, and you don't have
transparency issues, then I would further recommend that you draw the
image(s) to an offscreen buffer, and then blit them to the screen - much
faster then drawing the image each time.

Jordan

-- 
Jordan Crouse
Senior Linux Engineer
AMD - Personal Connectivity Solutions Group
<www.amd.com/embeddedprocessors>


Previous by date: 4 Nov 2005 18:20:45 +0000 [PATCH] don't overwrite definitions if already defined in device.h, Alexander Neundorf
Next by date: 4 Nov 2005 18:20:45 +0000 viewml image loading, emaroto.fr.abx.fr
Previous in thread: 4 Nov 2005 18:20:45 +0000 GrDrawImageFromFile, ER
Next in thread:


Powered by ezmlm-browse 0.20.