Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Rotator > RadImageItem Image Size

Not answered RadImageItem Image Size

Feed from this thread
  • Developer Developer avatar

    Posted on Sep 17, 2010 (permalink)

    I'd like for images within a RadImageItem to resize as the RadRotator resizes.  Does anyone know how to do this?  

    Any help would be greatly appreciated.  Thank you!

    Reply

  • Jack Jack admin's avatar

    Posted on Sep 23, 2010 (permalink)

    Hi,

    Thank you for this question.

    Currently this feature is not implemented in RadRotator. However, you can achieve this with a few lines of code. Please consider the following code snippet:
    private void Form1_Load(object sender, EventArgs e)
    {
        foreach (RadItem item in this.radRotator1.Items)
        {
            RadImageItem imageItem = item as RadImageItem;
            if (imageItem != null)
            {
                LightVisualElement lve = new LightVisualElement();
                lve.Image = imageItem.Image;
                lve.ImageLayout = ImageLayout.Stretch;
                lve.ZIndex = 1000;
                lve.StretchHorizontally = true;
                lve.StretchVertically = true;
                imageItem.Children.Add(lve);
            }
        }
    }

    I hope this helps. If you need further assistance, do not hesitate to ask.

    Sincerely yours,
    Jack
    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

    Reply

  • Omair avatar

    Posted on Oct 10, 2011 (permalink)

    Dear Telerik Team

    The given code is not working in my web application, RadItem and RadImageItem is not defined classes. 
    please help, how can i stretch images in a RadRotator in web application. 

    regards

    Reply

  • Slav Slav admin's avatar

    Posted on Oct 13, 2011 (permalink)

    Hello Omair,

    In case you want to stretch an image inside the ItemTemplate of a RadRotator according to the size of its items, please apply the CSS properties width:100% and height:100% to the image and add the following code snippet in the head section of your page:
    <style type="text/css">
        .rrClipRegion .rrItemsList .rrItem div
        {
            width: 100%;
            height: 100%;
        }
    </style>

    For you convenience I have attached a sample page, implementing the suggested solution. You can use it as a base for your further development.

    Note that you have posted your problem in the WinForms section of the forums and you are clearly using the RadRotator for ASP.NET AJAX. Please use this section in order to report future problems and difficulties with the control.

    Best wishes,
    Slav
    the Telerik team

    Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Rotator > RadImageItem Image Size
Related resources for "RadImageItem Image Size"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]