View previous topic :: View next topic |
Author |
Message |
imagex
Joined: 18 Apr 2007 Posts: 1
|
Posted: Wed Apr 18, 2007 4:50 pm Post subject: How to save a picture to sqlite,and how to display it? |
|
|
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 |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
Posted: Thu Apr 19, 2007 12:36 am Post subject: Re: How to save a picture to sqlite,and how to display it? |
|
|
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 |
|
|
|
|
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
|