This is a migrated thread and some comments may be shown as answers.

RadCarousel autosize to fit image

4 Answers 188 Views
Carousel
This is a migrated thread and some comments may be shown as answers.
Oliver
Top achievements
Rank 1
Oliver asked on 11 May 2011, 03:06 PM
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

4 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 12 May 2011, 03:37 PM
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
0
Oliver
Top achievements
Rank 1
answered on 12 May 2011, 04:47 PM
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
0
Maya
Telerik team
answered on 17 May 2011, 09:35 AM
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
0
Oliver
Top achievements
Rank 1
answered on 21 Feb 2012, 09:17 PM
Yes,

thank's
Tags
Carousel
Asked by
Oliver
Top achievements
Rank 1
Answers by
Maya
Telerik team
Oliver
Top achievements
Rank 1
Share this question
or