RadCarousel autosize to fit image

5 posts, 0 answers
  1. Oliver
    Oliver avatar
    263 posts
    Member since:
    Feb 2011

    Posted 11 May 2011 Link to this post

    Hi,

    in my WPF project, I fill dynamically images to a RadCarousel. I bind the ItemsCource to a List<Image> variable. I would like to know how I can specify to the carousel to strech all images to take maximum space available space keeping their aspec ratio.

    Actually, I have a small carousel with thumbnails, when a user the click on an image, I take all related images and then, transfert it into another window with a bigger carousel. The problem is, most of the images are bigger than the height of the screen resolution. I would like thoses images to shrink into the display area to prevent loosing details on the image.  I need the smaller images to grow to maximum size,

    Thank's
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 12 May 2011 Link to this post

    Hello Oliver,

    Generally, you cannot make the image fit the carousel item, but the other way around - make the CarouselItem to be sized according to its content. For example, you may set a style like follows:

    <Style  TargetType="{x:Type telerik:CarouselItem}">
                <Setter Property="Height" Value="100"/>
                <Setter Property="Width" Value="100" />
    </Style>

    In case the desired width and height of your images exceed the values set as maximum, you may predefine the MaxWidth and MaxHeight properties of the CarouselItem - just as the example above. 

    Regards,
    Maya
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Oliver
    Oliver avatar
    263 posts
    Member since:
    Feb 2011

    Posted 12 May 2011 Link to this post

    Ok,

    can you tell me if there is a way to get the display working area of a RadCarousel component, I mean, all the area inside the RadCarousel where all of items where displayed?

    Also, can you tell me if it's possible to have the front top item completly centered instead of having his position base on the RadCarousel scroll arc ratioÉ

    Thank's
  5. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 17 May 2011 Link to this post

    Hello Oliver,

    You may use the ActualWidth and ActualHeight properties of the RadCarousel. Considering your second requirement, does the forum thread mentioned in another communication of ours solve the issue ?  

    Greetings,
    Maya
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Oliver
    Oliver avatar
    263 posts
    Member since:
    Feb 2011

    Posted 21 Feb 2012 Link to this post

    Yes,

    thank's
Back to Top
UI for WPF is Visual Studio 2017 Ready