Hi I'm upgrading my graphics mill from ver 5 to ver 8 (from x84 to x64) and got into the following issue with the image printing job.
It's the basic printing function and I can make it work successfully with the dlls for .NET 2.0 (Aurigma.GraphicsMill.dll, Aurigma.GraphicsMill.WinControls.dll)
Any help would be so much appreciated.
An unhandled exception of type 'System.ArgumentException' occurred in Aurigma.GraphicsMill.dll
Additional information: Argument has an unappropriate value (Crop rect is not fully contained in the source image rect)..
stack trace:
at Aurigma.GraphicsMill.GMException.ThrowManagedException(IntPtr unmanagedException)
at Aurigma.GraphicsMill.PipelineElement.RunPipeline()
at Aurigma.GraphicsMill.Pipeline.Run()
at Aurigma.GraphicsMill.Transforms.Transform.Apply(Bitmap source)
at Aurigma.GraphicsMill.Transforms.Transform.ApplyAndDeleteTransform(Bitmap source, Transform transform)
at Aurigma.GraphicsMill.WinControls.ImagePrintItem.StripPrint(Bitmap pImage, Graphics pGraphics, Point objLeftTopPosition, Size objResizeSize, Rectangle objCropRectangle)
at Aurigma.GraphicsMill.WinControls.ImagePrintItem.ResizeAndPrintImage(Graphics pGraphics, Boolean bRotateImage, Size objDstSize, Point objLeftTopPosition)
at Aurigma.GraphicsMill.WinControls.ImagePrintItem.Print(Graphics pGraphics, Point objLeftTopPosition)
at Aurigma.GraphicsMill.WinControls.ImagePrintDocument.DoPrint(PrintPageEventArgs e)
at Aurigma.GraphicsMill.WinControls.ImagePrintDocument.OnPrintPage(PrintPageEventArgs e)
at System.Drawing.Printing.PrintController.PrintLoop(PrintDocument document)
at System.Drawing.Printing.PrintController.Print(PrintDocument document)
at System.Drawing.Printing.PrintDocument.Print()
at WindowsFormsApplication1.Form1.button1_Click(Object sender, EventArgs e) in c:\users\hungn\documents\visual studio 2015\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs:line 37
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at WindowsFormsApplication1.Program.Main() in c:\users\hungn\documents\visual studio 2015\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Program.cs:line 19
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
code:
Code:
private void button1_Click(object sender, EventArgs e)
{
PrintPlaceholder placeholder = new PrintPlaceholder();
placeholder.Image = new Aurigma.GraphicsMill.Bitmap(@"C:\Users\Public\Documents\aaa\aaa.png");
ImagePrintDocument imagePrintDocument = new ImagePrintDocument();
imagePrintDocument.Source = placeholder;
imagePrintDocument.PrinterSettings.PrinterName = "Send To OneNote 2010";
imagePrintDocument.PlacementMode = PlacementMode.SingleImage;
imagePrintDocument.PrintOptions.ImageAutoRotate = true;
imagePrintDocument.PrintOptions.PlaceholderAutoRotate = true;
imagePrintDocument.DefaultPageSettings.Margins = new System.Drawing.Printing.Margins(0, 0, 0, 0);
imagePrintDocument.Print();
}
Edited by user Tuesday, February 23, 2016 7:02:11 PM(UTC)
| Reason: Not specified