Quantcast
Channel: magick Discussions Rss Feed
Viewing all 3693 articles
Browse latest View live

New Post: Resize cause an "Attempted to read or write protected memory"

$
0
0
I cannot reproduce your problem. But this might be related to the recently added OpenCL acceleration. Can you disable OpenCL with the this: 'MagickNET.UseOpenCL = false;' and try it again?

Can you contact me through Codeplex and send me a crashdump (http://msdn.microsoft.com/en-us/library/d5zhxt22.aspx)? Even if this is resolved by disabling OpenCL I would still like to fix the problem.

New Post: Resize cause an "Attempted to read or write protected memory"

$
0
0
Hi,

Now the exception is triggered at
MagickNET.UseOpenCL = false;
Here the log:
System.AccessViolationException occurred
_HResult=-2147467261
_message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
HResult=-2147467261
IsTransient=false
Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Source=Magick.NET-x64
StackTrace:
   at Magick.EnableOpenCL(Boolean )
   at ImageMagick.MagickNET.SetUseOpenCL(Boolean value)
InnerException:


The dump (270MB) is disponible in dropbox at:
https://www.dropbox.com/s/uin6v60lrceetz4/ImageViewer2.dmp


Thanks

New Post: CMYK to RGB for JPEG

$
0
0
Thanks. I agree the colors are closer but they are still off. I'm not looking for perfection but perceptibly correct would be nice. Is there really no way to convert these images to match?

New Post: CMYK to RGB for JPEG

New Post: Resize cause an "Attempted to read or write protected memory"

$
0
0
Thank you very much for posting that dump but it seems you are using the AnyCPU version of Magick.NET. This is just a wrapper that loads either the x64 or the x86 version of Magick.NET. Could you provide me with a dump from Magick.NET-x64?

And it looks like your dump is from a debugger break point in VisualStudio. Can you run your program outside VisualStudio and create a dump there?

New Post: Resize cause an "Attempted to read or write protected memory"

$
0
0
Same thing with Magick.NET Q16-x64

System.AccessViolationException occurred
_HResult=-2147467261
_message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
HResult=-2147467261
IsTransient=false
Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Source=Magick.NET-x64
StackTrace:
   at Magick.EnableOpenCL(Boolean )
   at ImageMagick.MagickNET.SetUseOpenCL(Boolean value)
InnerException:

But now I see this warning:
Warning 1 There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "Magick.NET-x64", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. WindowsFormsApplication3


Is this the cause?

Thanks

New Post: Resize cause an "Attempted to read or write protected memory"

$
0
0
You should set the Properties -> Build -> Platform target to x64 to get rid of that warning. And you should still get the same exception. And I hope that a dump created outside VisualStudio will provide better information. I am now getting information from managed code but I want the stack trace from the unmanaged code.

New Post: Custom font from file.

$
0
0
It seems you can just specify the font with the file name. I was unaware that this was possible. The following code will use your font and draws some text on the image:
using (MagickImage image = new MagickImage("einsteinshow.jpg"))
{
  DrawableFont font = new DrawableFont(@"D:\Fonts\DK Crayon Crumble.ttf");
  DrawablePointSize size = new DrawablePointSize(72);
  DrawableStrokeColor strokeColor = new DrawableStrokeColor(new MagickColor("#fff"));
  DrawableFillColor fillColor = new DrawableFillColor(new MagickColor("#fff"));
  DrawableText text = new DrawableText(200, 100, "Magick.NET");
  image.Draw(font, size, strokeColor, fillColor, text);
  image.Write("einsteinshow.magick.jpg");
}

New Post: Custom font from file.

$
0
0
Thank you VERY much.
Sorry to bother you with that dumb question, when I saw the parameter for "family", I assumed it was for an installed font.

I've got a couple more questions.
The text appears to be bold, can set/unset that option?
Can I rotate the text...say 345 degrees?
etc...

I'm not asking you to solve all my problems, I'm just looking for some general guidance.
I've got no problem just experimenting and figuring things out...but I get a little lost since I'm just starting out.

Is there other documentation that I don't know about?
Are there other related projects that might give me some hints.

Again, thanks a ton getting me this far.

New Post: Custom font from file.

$
0
0
You should take a look at the Drawable classes in the code completion of Visual Studio. And it will take a lot of trail and error :)

Maybe you already found the following link on the documentation page but the examples from Anthony are great: http://www.imagemagick.org/Usage/.

To answer both your questions:

If you to make the text 'less bold' you should set the strokeColor to transparent:
DrawableStrokeColor strokeColor = new DrawableStrokeColor(MagickColor.Transparent);
And with the DrawableRotation class you can rotate the text:
DrawableRotation rotate = new DrawableRotation(345);
image.Draw(font, size, strokeColor, fillColor, rotate, text);

New Post: Resize cause an "Attempted to read or write protected memory"

New Post: Resize cause an "Attempted to read or write protected memory"

$
0
0
I noticed you did not enable 'Enable native code debugging' in the properties of WindowsFormsApplication3. A dump without this does not provide me with enough information. Can you enable this and post a new dump?

New Post: Convert pdf to png in 64bit

$
0
0
Thanks. It's already working. We just have to reset the server.

New Post: Change DPI (resolution) but keep same size

$
0
0
Hi,

I want ot upscale image DPI from 300 to 600 but at the same time I want to keep the image size otiginal (8.5*11), how can I do that?
Any thoughts?
Thank you.

New Post: Change DPI (resolution) but keep same size

$
0
0
You can change the DPI with the Resample method of MagickImage. The parameters are now described as width/height but it should be resolutionX and resolutionY. This will be changed in the next release.

Changing the DPI from 300 to 600 will resize the image to a bigger size. This will result in an image that has a lower quality so I am not sure why you would want that?

New Post: How to draw a transparent rectangle at a specific location, on a specific image?

$
0
0
Hi,

I'm trying to draw a transparent rectangle on a specific image using the below code.
privatestatic MagickImage ApplyWatermark(MagickImage image, string waterMarkText) {
    var backgroundOfWaterMark = new MagickImage(new MagickColor("#FFFFFF"), image.Width, 20) { Format = MagickFormat.Png };
    var img = image;
    img.Composite(backgroundOfWaterMark, 0, img.Height - 20);
    img.Format = MagickFormat.Png;
    var font = new DrawableFont("Batang");
    var text = new DrawableText(3, img.Height - 7, waterMarkText);
    var size = new DrawablePointSize(13);
    var fillColor = new DrawableFillColor(new MagickColor("#000000"));
    image.Draw(font, size, fillColor, text);
    backgroundOfWaterMark.Dispose();
    image.Dispose();
    font.Dispose();
    text.Dispose();
    size.Dispose();
    fillColor.Dispose();
    return img;
}
And I'm always ended up with a NOT transparent regular white rectangle. The part of the code that draws a text on that rectangle is working just fine. My problem is only that I need that rectangle to be a transparent/ opacity 0.5.

How can I do this? How can I do a white background with 50% opacity?

Thanks.

New Post: How to draw a transparent rectangle at a specific location, on a specific image?

$
0
0
The hex color notation also supports the alpha channel. Changing the color of backgroundOfWaterMark to "#FFFFFF80" should get you the color that you want. I will update the documentation to explain this better.

New Post: Resize cause an "Attempted to read or write protected memory"

New Post: How to draw a transparent rectangle at a specific location, on a specific image?

$
0
0
Thanks for a quick reply.

I've changed the code as follows.
var backgroundOfWaterMark = new MagickImage(new MagickColor("#FFFFFF80"), image.Width, 20) { Format = MagickFormat.Png };
No luck. I still ended up with a regular white background. The sample is here.

BTW: Can an Image format (MagickFormat.Png) has any relationship or effect the result I'm trying to achieve? Maybe the problem is here?

New Post: Resize cause an "Attempted to read or write protected memory"

$
0
0
I hope you are not starting to get sick of all my requests but I really want to fix this.

This dump is not reporting an exception? It looks like you are on a breakpoint in Visual Studio.

Feel free to take the discussion of board. You should have my e-mail when I contacted you through CodePlex a couple of days ago.
Viewing all 3693 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>