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

Need to create big custom icons

4 Answers 148 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
Selva M
Top achievements
Rank 2
Selva M asked on 16 May 2012, 01:42 PM
Hi Support,
   I'm working on a touch screen app which requires "Image Editor" control with big icons. I tried setting my custom images by setting width & height, but its not working...Can u give me a work around to achieve the desired result.

Thank u
Selva

4 Answers, 1 is accepted

Sort by
0
Accepted
Mihail
Telerik team
answered on 21 May 2012, 02:22 PM
Hello Selva,

You need to redefine the style of "RadImageEditorButton" in order to achieve big icons. Here is how you can do that:
 
<sys:String xmlns:sys="clr-namespace:System;assembly=mscorlib" x:Key="ImageThemeKeyString" >Default</sys:String>
<Style
    xmlns:telerikChromes="clr-namespace:Telerik.Windows.Controls.Chromes;assembly=Telerik.Windows.Controls"
    TargetType="telerik:RadImageEditorButton">
    <Setter Property="ImageThemeKey" Value="{StaticResource ImageThemeKeyString}"/>
    <Setter Property="IsBackgroundVisible" Value="False" />
    <Setter Property="HorizontalContentAlignment" Value="Left" />
    <Setter Property="VerticalContentAlignment" Value="Center" />
    <Setter Property="HorizontalAlignment" Value="Stretch" />
    <Setter Property="Height" Value="22" />
    <Setter Property="Margin" Value="0 1" />
    <Setter Property="CornerRadius" Value="0" />
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="telerik:RadImageEditorButton">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <telerikChromes:ButtonChrome
                    x:Name="ButtonChrome" Grid.ColumnSpan="2"
                    RenderNormal="{TemplateBinding IsBackgroundVisible}"
                    RenderMouseOver="{TemplateBinding IsMouseOver}"
                    RenderPressed="{TemplateBinding IsPressed}"
                    RenderFocused="{TemplateBinding IsFocused}"
                    CornerRadius="{TemplateBinding CornerRadius}"
                    RenderEnabled="{TemplateBinding IsEnabled}" />
 
                    <Image x:Name="Image" Width="16" Height="16"
                            VerticalAlignment="Center" Margin="8 0" HorizontalAlignment="Left"
                            RenderOptions.BitmapScalingMode="NearestNeighbor" RenderOptions.EdgeMode="Aliased"/>
 
                    <ContentPresenter x:Name="Content" Grid.Column="1"
                        Margin="{TemplateBinding Padding}"
                        Content="{TemplateBinding Content}"
                        ContentTemplate="{TemplateBinding ContentTemplate}"
                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                        RecognizesAccessKey="True"/>
                </Grid>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

 You need to change the height of the button at this line: 

<Setter Property="Height" Value="22" />

 and the Height and Width of the image at this line: 
<Image x:Name="Image" Width="16" Height="16"

 I hope this answer your question. If you have further questions do not hesitate to contact us again.


Kind regards,
Mihail
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Selva M
Top achievements
Rank 2
answered on 22 May 2012, 06:25 AM
Hi Mihail,
 Thanks it works great.

Selva.
0
Mihail
Telerik team
answered on 22 May 2012, 09:04 AM
Hi Selva,

I am glad I could help you.

All the best,
Mihail
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Selva M
Top achievements
Rank 2
answered on 22 May 2012, 11:09 AM
Thanks a lot!!!
Tags
ImageEditor
Asked by
Selva M
Top achievements
Rank 2
Answers by
Mihail
Telerik team
Selva M
Top achievements
Rank 2
Share this question
or