locked
ImageEditable RRS feed

  • General discussion

  • I have to write text dynamically on image,please tell me 

    Monday, June 18, 2012 3:47 AM

All replies

  • hi

    try like this...

    <UserControl.Resources>
            <Style x:Key="LabelStyle1" TargetType="sdk:Label">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="sdk:Label">
                            <Grid>
                                <Image Source="Travel_Mgnt.png" Stretch="Fill"/>
                                <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}"/>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </UserControl.Resources>

     <Grid x:Name="LayoutRoot" Background="White" Height="300" Width="400">
     <sdk:Label Height="28" HorizontalAlignment="Left" Margin="268,260,0,0" Name="label1" Style="{StaticResource LabelStyle1}" VerticalAlignment="Top" Width="120" />
    </Grid>

    and in code behind you can type the text dynamically

     public MainPage()   
          {  
               InitializeComponent();    
             label1.Content = "Text on img";
          }

    hope this helps you....

    Monday, June 18, 2012 4:41 AM