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

Insert Image

1 Answer 42 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
Tolga Tari
Top achievements
Rank 1
Tolga Tari asked on 11 Sep 2013, 08:24 PM
Hi, Im using that code block for add small image on the main image. Everything is fine, but when i add the small image on the main page, i can not change that small image position. I want move with mouse that small image after add.

Also, what is the insertImage last array parameter?

function imageEditorAddImage(img)
{
    var imgEditor = $find("imageEditor");
    imgEditor.insertImage(50, 50, '../../theme/images/editorImages/' + img, []);
}

Thank you

1 Answer, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 16 Sep 2013, 02:41 PM
Hello Tolga,

After executing the insertImage function, the added picture becomes a part of the main image and it cannot be edited further. What you could do is fire the Insert Image command
$find("imageEditor").fire("InsertImage")
that will display the dialog for inserting an image. The following code snippet will allow you to directly include the path to your picture in the input field of the dialog when it is opened:
$find("imageEditor").add_dialogLoaded(function (editor, args) {
    var widget = args.get_widget();
    widget._txtSrc.value = "path-to-small-picture";
    widget._okBtnHandler();
});

As for the last parameter of the function insertImage, it is used for setting operations that will modify the inserted image. This parameter is not documented, because it needs further improvement.

Regards,
Slav
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
ImageEditor
Asked by
Tolga Tari
Top achievements
Rank 1
Answers by
Slav
Telerik team
Share this question
or