Welcome Guest! You need to login or register to make posts.



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

Rank: Member

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

Hi i m using the following code taking from help

            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.ContentType = "image/jpeg";

            bitmap.Save(Response.OutputStream, encoderOptions);


and getting an exception

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

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

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 8/3/2003(UTC)
Posts: 1,070

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

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
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.