×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Apr 2014
    Posts
    12

    Resize image PNG format with JpegTools.AutoResizeAsync

    Hello,
    i use this code for resize async my images from stream.
    This code it works perfectly with JPG image.

    Code:
    IBuffer OriginalImage = StreamToBuffer(stream);
    IBuffer ResizedImage = null;
    ResizedImage = await ScaleAsync(OriginalImage);
                     
    private static async Task<IBuffer> ScaleAsync(IBuffer image)
                    {
    
                        uint maxBytes = 2 * 1024 * 1024; // 2 megabytes
                        using (var source = new BufferImageSource(image))
                        {
    
                            var info = await source.GetInfoAsync();
    
                            Windows.Foundation.Size maxSize = info.ImageSize;
                            maxSize.Width = 480;
                            maxSize.Height = 360;
    
                            var resizeConfiguration = new AutoResizeConfiguration(maxBytes, maxSize, new Windows.Foundation.Size(0, 0), AutoResizeMode.Automatic, 0.0, ColorSpace.Yuv420);
                            return await Nokia.Graphics.Imaging.JpegTools.AutoResizeAsync(image, resizeConfiguration);
    
                        }
                    }
    WITH PNG IMAGE Receive CRASH in this code
    return await Nokia.Graphics.Imaging.JpegTools.AutoResizeAsync(image, resizeConfiguration);

    How to resolve?
    Thanks
    Last edited by geniovi; 2014-06-17 at 17:52.

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

    Re: Resize image PNG format with JpegTools.AutoResizeAsync

    Hi.

    JpegTools works only with jpg and doesn't support PNG
    Windows 8, Windows phone 8 or Nokia Asha developer? Go to DVLUP

  3. #3
    Registered User
    Join Date
    Apr 2014
    Posts
    12

    Re: Resize image PNG format with JpegTools.AutoResizeAsync

    I know that, there is an alternative for png?
    I need a function like AutoResizeAsync but for png

  4. #4
    Regular Contributor
    Join Date
    Nov 2011
    Location
    la bouexiere, france
    Posts
    481

    Re: Resize image PNG format with JpegTools.AutoResizeAsync

    Quote Originally Posted by geniovi View Post
    I know that, there is an alternative for png?
    I need a function like AutoResizeAsync but for png
    Imaging SDK haven't PNG output. So you haven't simple solution :/

    You could generate an intermediare WriteableBitmp an use Cimbalino to generate the png file
    Windows 8, Windows phone 8 or Nokia Asha developer? Go to DVLUP

Similar Threads

  1. Resize image
    By makara in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2012-06-05, 14:57
  2. Replies: 2
    Last Post: 2012-03-12, 15:57
  3. Image resize
    By athir.gillani in forum Symbian User Interface
    Replies: 1
    Last Post: 2009-07-14, 07:38
  4. Image resize
    By saifulhq in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2008-04-03, 04:55
  5. how to resize rgb image
    By skumar_rao in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2005-08-25, 08:44

Posting Permissions

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