We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Read in the value of text entered in an SfImageEditor on the fly

Thread ID:

Created:

Updated:

Platform:

Replies:

149054 Nov 12,2019 08:41 PM UTC Nov 14,2019 01:49 PM UTC Xamarin.Forms 3
loading
Tags: SfImageEditor
Madhu Ganesh
Asked On November 12, 2019 08:41 PM UTC

I currently have a Page with an SfImageEditor and when I add a textbox to the image in the SfImageEditor, I want a way to read in what I type into that text box so I can either store that value in my database or paste that text in a read-only Xamarin.Forms Entry view below the SfImageEditor...can you please help me by providing a sample solution to do this.

Thank you,
Madhu

Rachel A [Syncfusion]
Replied On November 13, 2019 05:51 AM UTC

Hi Madhu, 
 
Greetings from Syncfusion. 
 
We can get the entered text from the text box in selected state using SelectedItemName argument in ItemSelected event. Find the code snippet below to achieve it. 
 
[C#] 
 
     imageEditor.ItemSelected += ImageEditor_ItemSelected; 
 
      private void ImageEditor_ItemSelected(object sender, ItemSelectedEventArgs args)
        {
            var Settings = args.Settings;
 

            if (Settings is TextSettings)
            {
                string text = args.SelectedItemName;
 
            } 
     } 
 
Please let us know if you have any concerns. 
 
Thanks, 
Rachel. 


Madhu Ganesh
Replied On November 14, 2019 12:41 AM UTC

Thank you Rachel. I tried out the provided solution and it works when I add a text box to the image editor as follows

imgEditor.AddText("Enter Text", new TextSettings());

The label below the editor shows the string "Enter Text" which is what I want.

When I click on the "Enter Text" text box, a dialog pops up where I can change the text so I change it to "ABC" and hit OK. But this new value does not get reflected in the Label below the SfImageEditor. How can I fix this?

I have to click someplace else on the image and then click the textbox again for the new text "ABC" to get reflected on the label...

Would I be able to use data binding to solve this problem or is there another way?

Thank you,
Madhu

Rachel A [Syncfusion]
Replied On November 14, 2019 01:49 PM UTC

Hi Madhu, 
 
We are currently having support to get the edited text when the text box is in selected stated using ItemSelected event in SfImageEditor. Also, there is no feasibility to get the edited text in sample level when changing it dynamically.  
 
Regards, 
Rachel. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon