Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
3.33/5 (3 votes)
See more:
What I wanna do is to save 3 picturebox as jpg but the output will only be the first image.jpg it's like others images are hidden. When my other program tries to open the file that I saved the images that are hidden must be shown. I don't know if I can call it hide unhide or encrypt decrypt but basically I want photoviewer to see only 1 image but my program can see other images behind it. I hope someone can give me Idea. I've tried to use cmd copy /b it's similar but the images doesn't come from picture box and I'm using archiver in extracting..

Thanks.....
Posted
Comments
Sergey Alexandrovich Kryukov 5-Nov-14 2:29am    
Why?
—SA
V. 5-Nov-14 2:32am    
Do I understand correctly that you want the data of three pictures in one picture, but only one "dataset" is known for an imageviewer, while your application can read all three datasets? I'm not sure why you would want to do this, but it seems tricky to me. You could look into the exif header and see if you can write the raw data there of the two hidden images (probably your best bet) or you can try to trick the image by setting img width and height to the first drawing, but writing the three datasets in the data section, but I'm pretty sure that will not work. It would be easier if the headers of the three images are the same. In that case, even if you have to serialize the binary data to fit into a header, you can reuse the header of the non-hidden image for creating the two hidden image. Hope I make a bit sense to you :-)

In any case you're in for a real challenge here.
Myvar 5-Nov-14 2:37am    
I think i know how let me write a demo and il get back to you.
yhogz 5-Nov-14 21:50pm    
Thanks man
V. 5-Nov-14 4:34am    
Countered the 1 vote. You could have provided more information perhaps, but I don't see it as a bad question.

What you want to do if i understand you is called Steganography[^]

You've got literally thousands of examples in the internet. A simple search here in codeproject steganography[^]

Steganography: Simple Implementation in C#[^]

Edit

After thinking a bit about it, I think there may be another way to accomplish something similar to what you want.
Instead of a jpeg image, you could create an animated GIF with all your images, and then in your program just show the first one. But if someone opens the image with another viewer,they could see all the images.
 
Share this answer
 
v2
Comments
V. 5-Nov-14 4:22am    
nice. I will read that sometime.
Although I have no idea about steganography, is the "hidden" data not limited in that case?
Pikoh 5-Nov-14 4:29am    
limited in what sense?
V. 5-Nov-14 4:32am    
Well, one of the links (I very, very quickly browsed through to be honest) mentioned it replaces unused bits and replaces them with other bits. I would think that "unused" bits are somewhat limited in a file.
But again I did not read through the entire articles so I might have missed a great deal. (no time, because this looks pretty interesting)
Pikoh 5-Nov-14 4:43am    
So you mean in size? Yes, i'm not a big expert in this technique, but it works as you said using not used bits,so you've got a size limit and probably your original image may lose quality. But as i told you, i'm not an expert :)
yhogz 5-Nov-14 21:45pm    
I'm looked into stenography and it's not what I need. I've seen command prompt (copy /b image.jpg+image.jpg filename.jpg) it's the closest to what I need. But there's no tut on how to create a viewer without using archiver software.
I've published an article about this subject. Now I think its just what you asked. I hope you like it:
Hiding data in an image file
 
Share this answer
 
Comments
yhogz 6-Nov-14 20:34pm    
Just what I've been looking for. 10 stars for this solution. Thanks man!!!
Pikoh 7-Nov-14 3:07am    
Glad it helps you :). Please mark solution as accepted so others looking for the same find it.
.NET has .zip functionality as of FrameWork 4.5. : [^].

If the copy /b technique is okay for you, then you could use that. But, of course, anyone with any smarts can force your file that appears to be .jpg or .png to open with WinRar or other archive readers.

You can invoke the DOS copy-merge command in .NET: here's an example: [^].

There are lots of tutorials here on CodeProject on using zip, rar, 7-zip, in .NET: just search for them.

Here's a May 2012 tutorial on using FrameWork 4.5's zip facilities: [^].
 
Share this answer
 

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