OutOfMemoryException large images

5 posts, 0 answers
  1. dev
    dev avatar
    20 posts
    Member since:
    Dec 2005

    Posted 03 Apr 2014 Link to this post

    Hi,
    I created a sample app:

    https://dl.dropboxusercontent.com/u/26312884/PhoneApp_SlideViewExample.zip

    I have OutOfMemoryException with large images.

    Do you have a Example for resolutions?
    I do not know how to solve
  2. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 07 Apr 2014 Link to this post

    Hello Ivan,

    Thanks for writing.

    It is very important to know that JPEG images are decoded to Bitmaps when visualized in a Windows Phone application. If a JPEG takes a megabyte to be stored, when decoded it will take the size of a Bitmap in the RAM. So, according to its physical dimensions, this size might be 30-40-50-60 megabytes.

    A Windows Phone application has limitations on the amount of RAM it can use. For Windows Phone 7 the memory cap is set to be 90 MB. So, as you can see, opening just a single image might crash your application.

    The simple rule of thumb here is to use thumbnails. Basically, you need to calculate the size of your images in such a way, that you comply with the memory limitations imposed on your application.

    I hope this is helpful.

    Regards,
    Deyan
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. DevCraft banner
  4. dev
    dev avatar
    20 posts
    Member since:
    Dec 2005

    Posted 07 Apr 2014 Link to this post

    Hello,
    thank you for response.
    i'm read in your documentation integration between SLIDEVIEW and RadBusyIndicator.

    I'm implemented on my project but not it works (not show progress or busy indicator)

    this is a code

    <Grid x:Name="LayoutRoot" Background="Transparent">
     
            <telerikPrimitives:RadSlideView x:Name="slideView"
                                            ItemsSource="{Binding}"
                                            IsFilmstripModeEnabled="True"
                                            ItemRealizationMode="ViewportItem"
                                            IsLoopingEnabled="True">
                <telerikPrimitives:RadSlideView.ItemContainerStyle>
                    <Style TargetType="slideView:SlideViewItem">
                        <Setter Property="BusyIndicatorStyle">
                            <Setter.Value>
                                <Style TargetType="telerikPrimitives:RadBusyIndicator">
                                    <Setter Property="AnimationStyle" Value="AnimationStyle7" />
                                    <Setter Property="InitialDelay" Value="0:0:0"/>
                                    <Setter Property="Visibility" Value="Visible" />
                                </Style>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </telerikPrimitives:RadSlideView.ItemContainerStyle>
                <telerikPrimitives:RadSlideView.ItemTemplate>
                    <DataTemplate>
                        <telerikPrimitivesSlideView:PanAndZoomImage Source="{Binding ImageSource}" Stretch="Uniform" ZoomMode="Free" />
                    </DataTemplate>
                </telerikPrimitives:RadSlideView.ItemTemplate>
                <telerikPrimitives:RadSlideView.FilmstripModeItemTemplate>
                    <DataTemplate>
                        <Image Source="{Binding ThumbnailSource}" Width="480" Stretch="Uniform"/>
                    </DataTemplate>
                </telerikPrimitives:RadSlideView.FilmstripModeItemTemplate>
            </telerikPrimitives:RadSlideView>
     
        </Grid>

  5. Todor
    Admin
    Todor avatar
    778 posts

    Posted 08 Apr 2014 Link to this post

    Hello,

    I have answered to your support ticket regarding the same question. In short, in your project the indicator is not displayed because the images are loaded fast enough so it is redundant.

    Regards,
    Todor
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  6. dev
    dev avatar
    20 posts
    Member since:
    Dec 2005

    Posted 08 Apr 2014 in reply to Todor Link to this post

    Ok thanks
Back to Top
DevCraft banner