Hi,
Im wrting a software that uses normal images (.png, .gif, .tif etc) and adds labels to them. So naturally, I have the image file and the file that contains label info. Is it possible to include image into a text file along with the label info? I could write the image pixel by pixel but I want to have the compression of PNG (or GIF) if the user is using those types of images. I would prefer not to have two separate files which is why Im asking.
Thanx.
Loading
Alex KobyPosted Jan 5, 2009, 4:13 PM
[code]RichTextBox box=new RichTextBox();
box.Text="This is a line";
Clipboard.SetDataObject(Image.FromFile("image.gif"));
box.Paste(DataFormats.GetFormat(DataFormats.Bitmap));
box.SaveFile("file.rtf");[/code]
and it created a 4MB rtf file when image.gif is only 16.3KB. It saved it as a bitmap with 6bytes per pixel (OMG even I can do better than that). I tried DataFormats.Dib and DataFormats.Tiff, the first one is the same as Bitmap and the second doesnt write the image at all.
I was thinking of somehow getting 2 streams (one text and one image) from the file. Not sure if it is possible or if I can do it.
Scott LyslePosted Jan 5, 2009, 2:50 PM