Page 1 of 1

load pcx file and write to stream

Posted: 2010-02-10T16:34:36-07:00
by nooBody
Hello everybody,
I have to code some project in C# and I have to work with pcx files. I would like to try your ImageMagick project. But when I use it, I have some problems. I explane all my problems.

At the begenning I use VS2010 beta1.
I referenced in my project MagickNet.dll in version 1.0.0.3 from this http://midimick.com/magicknet/magickDoc.html

So I show part of my code:

Following code works file, but I cannot save image to disk, then load new image, then work with image, and then remove from disk

Code: Select all

                        MagickNet.Magick.Init();
                        MagickNet.Image img = new MagickNet.Image(path); // load pcx - OK
                        img.Write("conversation.bmp"); // 
                        MagickNet.Magick.Term();
Follow code doesnot do, what I want.

Code: Select all

                        MemoryStream ms = new MemoryStream(); // stream for image data
                        MagickNet.Magick.Init();
                        MagickNet.Image img = new MagickNet.Image(path);
                        img.Write(ms, "bmp"); //in ms is loaded pcx file, but I want to have converted to bmp file.
                        MagickNet.Magick.Term();
I would like to have in "ms" memorystream loaded converted pcx file. (I would like to have in ms bmp file).


I tried this too, but similar problem.

Code: Select all

                        MagickNet.Magick.Init();
                        MagickNet.Image img = new MagickNet.Image(path); // load pcx - OK
                        System.Drawing.Image image = MagickNet.Image.ToBitmap(img); // in img is loaded pcx file -> I cannot convert to bitmap -> exception 
                        MagickNet.Magick.Term();
Can you someone help me? I will be very happy :) Sorry for my simple english.

Re: load pcx file and write to stream

Posted: 2010-02-11T19:09:20-07:00
by magick
We did not write nor do we support MagickNet. You'll need to contact the authors of MagickNet for help.