Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
3.33/5 (3 votes)
See more:
Hello,

I'm tring to encode an image file that after the encoding the image will be black and decode it by entering a password (that set by the user).

Can anyone help me with that?

Thanks!!!!
Posted

1 solution

Easy,
0) Use fancy algorithm to encode images, (Images won't we displayed by any software, because they are encoded).
1) Read your encoded image. var data = File.ReadAllBytes("<path>");
2) Decode byte array. Use some fancy algorithm.
3) Restore image, var img = new Bitmap(new MemoryStream(data)); and display in on the form.
 
Share this answer
 
v2
Comments
mishkaPishka 11-May-11 3:26am    
Hey
first, im using winform with C#.
second, i have problem to encode my file first so i have nothing to read yet.
my question is how to encode the image
Sergey Alexandrovich Kryukov 11-May-11 3:38am    
Winforms: irrelevant. By the way, "new Bitmap" is from System.Drawing which is usually used with Froms. Encode: "0) Encode image bytes. Use some fancy algorithm." Better now?
--SA
Sergey Alexandrovich Kryukov 11-May-11 3:36am    
Not too bad. Just add the item "encode". My 4.
--SA
Olivier Levrey 11-May-11 4:18am    
I agree. Have a 5.

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