Hi, how can I set the default value for Draw Shape and Draw Text element. For example I set the default value border thickness=3 , shape color = red, shape fill = transparent. For now, all the setting I need to set at the DrawShapeDialog. Can I hide this pop up? So that user can straight forward to make a draw.
3 Answers, 1 is accepted
The following code snippets demonstrates how to draw directly a predefined shape or text in RadImageEditor without the necessity of showing the respective dialog:
private void radButton1_Click(object sender, EventArgs e)
{
ShapeInfo info = new ShapeInfo(ShapeType.Square, Color.Red, Color.Yellow,3);
this.radImageEditor1.ImageEditorElement.StartDrawing(info);
}
private void radButton2_Click(object sender, EventArgs e)
{
this.radImageEditor1.ImageEditorElement.DrawString(
"Text to draw",
18, //font size
Color.Yellow, //Text color
100, //horizontal position
50, //vertical position
45);
}
I hope this information helps. If you need any further assistance please don't hesitate to contact me.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Hello, Sabel,
Please refer to the following modified code snippet demonstrating how to access the RadColorBox control which controls the border color: public class CustomImageEditorDialogFactory : ImageEditorDialogFactory
{
public override ImageEditorBaseDialog CreateDialog(Type type, RadImageEditorElement imageEditorElement)
{
ImageEditorBaseDialog dialog = base.CreateDialog(type, imageEditorElement);
if (dialog is DrawShapeDialog)
{
((RadColorBox)dialog.Controls[0].Controls["radColorBoxBorder"]).Value= Color.Red;
}
return dialog;
}
}
If you are not sure what is the name of the exact control, you can always download the source code from your Telerik account and inspect the default implementation for the dialog.
Should you have further questions please let me know.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.