Unplanned
Last Updated: 17 Apr 2024 14:31 by ADMIN
John
Created on: 21 May 2020 10:00
Category: Buttons
Type: Bug Report
2
RadButton: ImageLayout is not properly respected in ImagePrimitive and the SVGImage is not sized as expected
Please use the following code snippet and try to resize the button as it is illustrated in the attached gif file: 
            this.radButton1.ButtonElement.ImagePrimitive.SvgImage = RadSvgImage.FromFile(@"..\..\image.svg");
            this.radButton1.TextImageRelation = TextImageRelation.TextBeforeImage;
            this.radButton1.ButtonElement.ImagePrimitive.ImageLayout = ImageLayout.Zoom; 
            this.radButton1.ButtonElement.ImagePrimitive.StretchVertically = true;
            this.radButton1.ButtonElement.ImagePrimitive.StretchHorizontally = true;
Attached Files:
1 comment
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 21 May 2020 10:07

Hi, John,

I confirm that it is an issue with the ImagePrimitive that is internally used in RadButton.

Currently, the possible solution that I can suggest is to use a LightVisualElement instead. Please refer to the following code snippet which result is illustrated in the gif file: 

            LightVisualElement lveSVG = new LightVisualElement(); 
            lveSVG.Text = "Click";
            lveSVG.DrawText = true;
            lveSVG.TextImageRelation = TextImageRelation.TextBeforeImage;
            this.radButton1.Text = "";
            lveSVG.ImageLayout = ImageLayout.Zoom;
            lveSVG.SvgImage = RadSvgImage.FromFile(@"..\..\image.svg");
            this.radButton1.ButtonElement.Children.Add(lveSVG);

I believe that it would fit your requirements.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Attached Files: