www.sdlsuite.com Forum Index www.sdlsuite.com
Discussion of technical aspects of the SDL Component Suite
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Storing bitmaps in GeoDB

 
Post new topic   Reply to topic    www.sdlsuite.com Forum Index -> GeoPack
View previous topic :: View next topic  
Author Message
jvgoor



Joined: 07 Sep 2011
Posts: 42
Location: Maasland, The Netherlands

PostPosted: Wed Sep 28, 2011 4:42 pm    Post subject: Storing bitmaps in GeoDB Reply with quote

This post is related to my previous post about easily seeing what is in GeoDB and also to my post about tiles.

I can cut a Geomap up in to many tiles, all 128x128 pixels. Everytime I copy a piece of the Geomap.MapImg.Canvas to a dynamically created bitmap, store this to a Memorystream and then store this Memorystream in GeoDB.AddBLOB. Something is stored as I can see the files size of the GeoDB file growing with the amount of bytes of the original cut up image.

After this I determin the min and max of latitude and longitude of the data in GeoDB, create an empty Geomap with these points and then in the OnDataRendered procedure I read all tiles and plot them (copy them) on the canvas of the Geomap. As far as I can see I get the lat and long of the Data right, but there is no image of the tile. Like only a white image is stored or the data is not read right. I use the retrieveBLOB with a Memorystream and I load a bitmap from the Memorystream after which I get the lat and long rect with GeoDB.Data[] and then copy this rect to the canvas in OnDataRendered.

Maybe anybody reading this has some clue or suggestions?

Greetings,

Jaap
_________________
Jaap van Goor
Promanent b.v.
Back to top
View user's profile Send private message Visit poster's website
jvgoor



Joined: 07 Sep 2011
Posts: 42
Location: Maasland, The Netherlands

PostPosted: Wed Sep 28, 2011 5:44 pm    Post subject: Reply with quote

I found the solution. After reading the Blob in to the Memorystream with GeoDB.RetrieveBLOB, set MemoryStream.Position to 0 or the start where it was before retrieving the last BLOB. After this bitmap.LoadfromStream(MemoryStream) will correctly load the stored image.
_________________
Jaap van Goor
Promanent b.v.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.sdlsuite.com Forum Index -> GeoPack All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group