Page 1 of 1

problem regarding magicnet.dll

Posted: 2009-03-12T11:00:22-07:00
by subhajit_bumba
Hi,
I am using magicNet.dll in my project. In my project I need to crop one image more than one times. I write the code, but first time its gives correct result, but after that when I am trying to crop that 1st cropped image its gives wrong result. I am just stuck into that. My coding is like below,

magicnet.magic.image img; ...................... in the top.
form_load-


img=new magicnet.magic.image(filename);

void crop()
{
MagickNet.Magick.Init();
img = new MagickNet.Image(img);
//img1 = img;
img.Crop(rec);
picViewer.Image=MagickNet.Image.ToBitmap(img);
MagickNet.Magick.Term();
}

here rectangle value i am getting from mouse move. Please help me.

Re: problem regarding magicnet.dll

Posted: 2009-03-12T11:08:28-07:00
by magick
After the first crop you have a virtual canvas. Reset the virtual canvas. From the command line its +repage or -page 0x0+0+0. We didn't write MagickNet. Do they have a page operation?

Re: problem regarding magicnet.dll

Posted: 2009-03-12T21:42:31-07:00
by subhajit_bumba
thanks for reply. Yes they have page operation I have tested with the below code,

imgQc.Page.Width=0;
imgQc.Page.Height=0;
imgQc.Page.XOff=0;
imgQc.Page.YOff=0;


but the result coming same.

Re: problem regarding magicnet.dll

Posted: 2010-01-08T06:49:18-07:00
by leszy
Hi,

After each cropping, do this:
image.Page = new Geometry(0,0,0,0)

It assigns zeros to those Page properties
plus it does some mysterious work that is required here.
(Do not know exactly what. Haven`t seen the source code)

It helped in my case.

Greetings,

Leszy