×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Mar 2014
    Posts
    5

    Rotate with auto crop

    Hello!

    I am having a hard time finding a way to rotate an image with auto-crop once I upgraded the SDK from beta. In the beta version you were able to create a RotationFilter and use the RotationResizeMode to determine the resize behavior. There is no such option with the updated SDK. The ReframeFilter (plus applying rotation) doesn't seem to work this way either. Any ideas? Thank you so much for your help!!

  2. #2
    Regular Contributor
    Join Date
    Nov 2011
    Location
    la bouexiere, france
    Posts
    477

    Re: Rotate with auto crop

    Hi.
    Unfotunately, this feature have been removed.
    Which mode do you need?
    Windows 8, Windows phone 8 or Nokia Asha developer? Go to DVLUP

  3. #3
    Registered User
    Join Date
    Mar 2014
    Posts
    5

    Re: Rotate with auto crop

    Thank you for the response! Wow, that is terrible news, it's such a useful feature. I want to auto-crop the image when it is rotated so that there is no black space. I believe I was using RotationResizeMode.FitInside. If there is no workaround built into the SDK, any ideas on how to do the math manually?

  4. #4
    Regular Contributor
    Join Date
    Sep 2012
    Location
    Morocco
    Posts
    298

    Re: Rotate with auto crop

    For the FitInside mode you don't have much math to do, you'll Reframe or crop the image (with the ReframeFilter/CropFilter) to the original size of the image relatively to the center of the image :

    OriginalWidth, OriginalHeight //suppose it's your image width and height
    NewWidth, NewHeight // image width and height after rotation
    DifWidth = NewWidth - OriginalWidth //compute the difference between old and new width
    DifHeight = NewHeight - OriginalHeight

    the Rectangle to use in the CropFilter would be :
    Code:
    var rect = new Rect(difWidth/2,difHeight/2,OriginalWidth,OriginalHeight)

Similar Threads

  1. N97 - Auto Rotate not working?
    By jarop in forum General Development Questions
    Replies: 3
    Last Post: 2011-03-29, 12:11
  2. Auto rotate problem on n97
    By fpstudios in forum [Archived] Flash Lite on Nokia Devices
    Replies: 1
    Last Post: 2009-08-17, 15:20
  3. Auto rotate Canvas on N95
    By hweIPSQUARE in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2008-06-04, 09:06
  4. N78 - with or without auto rotate sensor?
    By sledgehammer89 in forum General Development Questions
    Replies: 6
    Last Post: 2008-03-06, 21:36

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×