FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to save a picture to sqlite,and how to display it?

 
Post new topic   Reply to topic     Forum Index -> DFL
View previous topic :: View next topic  
Author Message
imagex



Joined: 18 Apr 2007
Posts: 1

PostPosted: Wed Apr 18, 2007 4:50 pm    Post subject: How to save a picture to sqlite,and how to display it? Reply with quote

I can display the picture like this:

Code:
picbox.image  = new Picture("e:/xxx.bmp");


If I want to load it from sqlite,and display it?Before that,how to save the picture from local disk to sqlite?
Back to top
View user's profile Send private message
Chris Miller



Joined: 27 Mar 2004
Posts: 514
Location: The Internet

PostPosted: Thu Apr 19, 2007 12:36 am    Post subject: Re: How to save a picture to sqlite,and how to display it? Reply with quote

Saving binary to sqlite requires you to pass the data through a conversion function that escapes values that are illegal in the SQL queries. There is a function provided by sqlite to do this. You will have to do the opposite conversion when retrieving from the database.

Picture also lets you load the data from a Stream, so you can wrap the image data from sqlite in a MemoryStream and load it this way.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DFL All times are GMT - 6 Hours
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