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



Go to last post Go to first unread
#1 Posted : Monday, June 19, 2006 6:05:26 AM(UTC)

Rank: Member

Groups: Member
Joined: 7/6/2005(UTC)
Posts: 16


Should the following code work?

        tnfResize = New Aurigma.GraphicsMill.Transforms.Resize

        tnfResize.Width = intWidth
        tnfResize.Priority = Threading.ThreadPriority.Highest
        tnfResize.ResizeMode = GraphicsMill.Transforms.ResizeMode.Shrink
        tnfResize.InterpolationMode = GraphicsMill.Transforms.InterpolationMode.HighQuality

        Catch ex As Exception
            Throw New Exception("Error resizing image to " & tnfResize.Width & " width.")
        End Try

Currently, it's throwing the exception:

System.ArgumentOutOfRangeException was caught
  Message="Specified argument was out of the range of valid values.
Parameter name: destHeight"
       at Aurigma.GraphicsMill.SyncHandler.OnThreadStopped(Exception exception)
       at Aurigma.GraphicsMill.SyncHandler.OnThreadStoppedHandler(Object sender, ErrorEventArgs e)
       at Aurigma.GraphicsMill.Thread.raise_Stopped(Object i1, ErrorEventArgs i2)
       at Aurigma.GraphicsMill.Thread.TimerEventProcessor()
       at Aurigma.GraphicsMill.Thread.ChangeActivityStatus(ActivityStatus status)
       at Aurigma.GraphicsMill.Thread.EntryPoint()
       at Aurigma.GraphicsMill.Thread.Start()
       at Aurigma.GraphicsMill.Transforms.BitmapTransform.ApplyTransform(Bitmap bitmap)
       at Imaging.ScaleImageAsMemoryStream(String strFileName, Int32 intWidth) in R:\...\:line 108

In the documentation, it states if you set the other parameter when resizing to 0, it's calculated automatically.

Has anyone else gotten this to work? I'm using the 3.5 assemblies for .NET 2.0

Edited by user Wednesday, December 19, 2007 4:16:38 PM(UTC)  | Reason: Not specified

#2 Posted : Monday, June 19, 2006 8:03:44 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)

Resize transformation can work in 3 modes:
  • Fit - resizes bitmap dimensions according to rectangle, into which the image should be inscribed (preserves proportions of image);
  • Shrink - the same as Fit, but the resize occurs only if resize dimensions are smaller than image dimensions;
  • Resize - resizes dimensions of bitmap to specified values (in general, proportions are not preserved).
    So the first two modes requires fully specified rectangle - you cannot set width or height as 0. If you use Resize mode - you can set one of dimensions as 0 to preserve proprtions.
  • 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.