Status & Roadmap
Authors & License
Funding Ultimate++
Search on this site
Search in forums

SourceForge.net Logo
Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Delayed Image Loading
Delayed Image Loading [message #9881] Wed, 06 June 2007 09:43 Go to next message
WebChaot is currently offline  WebChaot
Messages: 52
Registered: September 2006
Location: Austria, Vienna
Hi all!

Hope you can help me. I'm sure, the solution is not to hard - but I do not have much experience with pointers and references - and I think, this is, what I would need here:

1. First I want to create GUI elements dynamically (which still works - thanks mirek). Some of these elements have images (like menu items or buttons). These Images I want to load later on from a database via thread. Therefore on each new GUI Item I create a new image and add it to an ImageQueue (ArrayMap of Images).

2. Do some other stuff.

3. Now load all images from ImageQueue and replace the content of images I created during GUI creation.

(Storing and Loading Image from Database is still tested and works! So thats not the problem.)

What I did try:

Image test;

bar.Add("Menu1", test, THISBACK(something));

... other stuff ...

call thread with GetImage(String ImageId, Image img);

GetImage("ImageIdInDatabase", test);

The Postback will send back the image I gave in GetImage and the imagebuffer read from database. But when I try to do

test = LoadImageFromString(imagebuffer);

(which still works without tread) the image of menu item will not be replaced.

Hope, you know, what I mean and what I want to do,

thanks in advance,

Re: Delayed Image Loading [message #9882 is a reply to message #9881] Wed, 06 June 2007 10:05 Go to previous message
mirek is currently offline  mirek
Messages: 12497
Registered: November 2005
Ultimate Member
Not really sure, anyway, this got my attention:

GetImage(String ImageId, Image img);

This passes img to GetImage *by*value*. This means that if you assign anything to img in GetImage, it will be assigned just to local copy and never visible outside GetImage routine.

Maybe you wanted this:

GetImage(String ImageId, Image& img);

or perhaps

Image GetImage(String ImageId);

Previous Topic: DrawImage scaling
Next Topic: blending images
Goto Forum:

Current Time: Wed May 27 04:50:37 CEST 2020

Total time taken to generate the page: 0.01447 seconds