Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am creating an application that does the following
1. Retrieves images stored in the db
2. Copies it to a location on the hard disk
3. Displays the image
how do i do this?
4. delete the image and still show it in my viewer or even if i could secure my image in some way, that would also work for me

I am using KpImageViewer that was built by jordy Ruiter from codeproject and in here, when i use the Dispose on the image viewer as in
C#
kpImageViewer1.dispose();
function the image also gets deleted so i tried
C#
kpImageViewer.Image.Dispose();
that keeps the image in memory but now i cannot scroll through the image.

I would be glad if someone could show me the way to either securing my images eg. encrypting then or something of that sort or a way around keeping this problem
Posted

1 solution

Steps 1-3 are widely reported about on the web. They are trivial. However, when you get the bytes of the image from the DB, you can load them in to an Image without storing them to the HDD. This is also widely reported on the web, Bitmap.FromStream is what you need to do this. Once your image viewer has the image, the only reason it could have for needing the file, is if it's tiling the image, if your control does that, you probably can't do a thing. If you encode the image, which is easy to do, it would need to be decoded before it's saved to the HDD, if your image viewer is trying to read it.

What national secrets are in your images that you think people will try to steal them ? What will stop them from hitting Control-PrintScreen and just grabbing them from inside your viewer, if they are that valuable ?
 
Share this answer
 
Comments
Tanmay_D 7-Aug-11 0:19am    
i know what you mean..but the problem is that i am building this for a friend of mine and you cannot argue about this with lawyers,now can you!! :D any way thanks for the prompt reply..and i didnt know bitmap.FromStram was there..thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900