New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Add text to an image on specific position via JavaScript

Updated over 6 months ago

Environment

ProductRadImageEditor for ASP.NET AJAX

Description

Learn below how to add text to an image on specific position within RadImageEditor.

Solution

You can attach a button click event and execute the function below to get a reference to the ImageEditor and add text to an image on a specific position:

JavaScript
function AddTextToImage() {
    var editor = $find("<%=RadImageEditor.ClientID%>"); //get reference to RadImageEditor on the client

    var text = new Telerik.Web.UI.ImageEditor.ImageText();
    text.set_text("Test !!!");
    editor.addTextToImage(20, 50, text);
}
In this article
EnvironmentDescriptionSolution
Not finding the help you need?
Contact Support