Skip to main content
All docs
V25.1
  • DevExpress v25.1 Update — Your Feedback Matters

    Our What's New in v25.1 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

    Take the survey Not interested

    CarouselImageSizeMode Enum

    Lists image size modes.

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.1.dll

    NuGet Package: DevExpress.Blazor

    #Declaration

    C#
    public enum CarouselImageSizeMode

    #Members

    Name Description
    FillAndCrop

    The image is scaled to fill the entire content area. The component preserves the image’s aspect ratio and clips the image if necessary.

    FitProportional

    The image is scaled to fit the content area. The component preserves the image’s aspect ratio and applies “letter-boxing” if necessary.

    #Related API Members

    The following properties accept/return CarouselImageSizeMode values:

    #Remarks

    Use the ImageSizeMode property to specify how the component scales an image to fit or fill the content area.

    DxCarousel - Image Size Modes

    Razor
    <DxCarousel Width="500px"
                Height="300px"
                Data="@GetCarouselData()"
                LoopNavigationEnabled="true"
                ImageSizeMode="CarouselImageSizeMode.FillAndCrop">
    </DxCarousel>
    
    @code {
        List<CarouselData> GetCarouselData() {
            List<CarouselData> result = new List<CarouselData>();
            result.Add(new CarouselData("../images/image1.jpg", "Image 1"));
            result.Add(new CarouselData("../images/image2.jpg", "Image 2"));
            // ...
    
            return result;
        }
    
        public class CarouselData {
            public string Src { get; set; }
            public string Alt { get; set; }
    
            public CarouselData(string src, string alt) {
                Src = src;
                Alt = alt;
            }
        }
    }
    
    See Also