This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Notification

Icon
Error

Options
Go to last post Go to first unread
tolisss  
#1 Posted : Sunday, September 24, 2006 5:22:45 PM(UTC)
tolisss

Rank: Member

Groups: Guest
Joined: 9/24/2006(UTC)
Posts: 1

Hi i m using the following code taking from help

Code:
            Bitmap bitmap = new Bitmap(@"D:\NET Solutions\C#\WM\DiamantiLand\images\photos\2.jpg");

            //Resize to 80 pixels width 
            bitmap.Transforms.Resize(80, 0, InterpolationMode.MediumQuality);

            //Specify that we are going to save to JPEG
            JpegEncoderOptions encoderOptions = new JpegEncoderOptions();

            //Save image to response stream
            Response.Clear();

            Response.ContentType = "image/jpeg";

            bitmap.Save(Response.OutputStream, encoderOptions);

            Response.End();

and getting an exception

Code:
Exception Details: System.InvalidProgramException: Common Language Runtime detected an invalid program.

Source Error: 


Line 32: 
Line 33:             //Resize to 80 pixels width 
Line 34:             bitmap.Transforms.Resize(80, 0, InterpolationMode.MediumQuality);
Line 35: 
Line 36:             //Specify that we are going to save to JPEG
 

Source File: D:\NET Solutions\C#\WM\Manager.2\Manager\WebForm1.aspx.cs    Line: 34 

Stack Trace: 


[InvalidProgramException: Common Language Runtime detected an invalid program.]
   Aurigma.GraphicsMill.Thread.FireStoppedEvent(Object object, ErrorEventArgs args) +360
   Aurigma.GraphicsMill.Thread.TimerEventProcessor() +457
   Aurigma.GraphicsMill.Thread.ChangeActivityStatus(ActivityStatus status) +269
   Aurigma.GraphicsMill.Thread.EntryPoint() +640
   Aurigma.GraphicsMill.Thread.Start() +308
   Aurigma.GraphicsMill.Transforms.BitmapTransform.ApplyTransform(Bitmap bitmap) +564
   Aurigma.GraphicsMill.TransformsProvider._Resize(Int32 width, Int32 height, ResizeMode resizeMode, InterpolationMode interpolationMode) +567
   Aurigma.GraphicsMill.TransformsProvider.Resize(Int32 width, Int32 height, InterpolationMode interpolationMode) +356
   Manager.WebForm1.Page_Load(Object sender, EventArgs e) in D:\NET Solutions\C#\WM\Manager.2\Manager\WebForm1.aspx.cs:34
   System.Web.UI.Control.OnLoad(EventArgs e) +175
   System.Web.UI.Control.LoadRecursive() +137
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2096

ps:using latest donet demo version

Edited by user Wednesday, December 19, 2007 2:18:08 PM(UTC)  | Reason: Not specified

Dmitry  
#2 Posted : Sunday, September 24, 2006 11:08:07 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Guest
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Hello,

I have adapted your code to be compiled. It does not generate an InvalidProgramException. Could you create a complete,

compiling sample which produces the error? Could you also submit case with your source sample image?

Edited by user Thursday, May 22, 2008 9:39:54 PM(UTC)  | Reason: Not specified

Sincerely yours,

Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!

Users browsing this topic
Guest (3)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.