With Q2 2013 we released RadImageEditor as part of our control suite for Windows Phone 8. We immediately got feedback from users asking whether it will be ported to WP7 and also whether it will support text drawing. For the Q2 2013 SP1 release we did just that. We ported RadImageEditor to WP7 and added text editing capabilities.

TextTool

The new text functionality is implemented by the new TextTool class. Like all other tools, TextTool provides a default UI so that text can be drawn inside RadImageEditor but it can also be used to render text on an image in the background.
The default text editor UI provides several sub tools at the end user's disposal. They can change the text itself, adjust the color, lightness, opacity, character spacing, line height and the font. The text can also be resized with a resize gizmo which appears when the text is selected. Finally the result can be positioned at an arbitrary location by dragging it around with a pan gesture.


Customization

The default text UI is generated by the TextToolUIControl class. It has properties of type DataTemplate for each sub tool which allows each separate tool UI to be overridden with minimal effort. Here's the default hue editor:


To override it developers only need to set a new style for TextToolUIControl and set the HueUI property:
<Style TargetType="telerikImageEditor:TextUIControl">
    <Setter Property="HueUI">
        <Setter.Value>
            <DataTemplate>
                <Grid>
                    <!--hue ui-->
                </Grid>
            </DataTemplate>
        </Setter.Value>
    </Setter>
</Style>

Note: The data context of this DataTemplate is the TextTool itself so any property bindings will be relative to the API that TextTool exposes.

Finally usage of TextTool is straightforward, like any other tool, just add it to RadImageEditor and you’re good to go:
<telerikImageEditor:RadImageEditor>
    <telerikImageEditor:TextTool/>
</telerikImageEditor:RadImageEditor>

Feel free to test the new features and let us know if you’d like something changed or added. Cheers.


About the Author

Viktor Skarlatov

Software Developer,
Windows Phone Team

Related Posts

Comments