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

RadImageEditor Image Loading

3 Answers 347 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
Rodrigo
Top achievements
Rank 1
Rodrigo asked on 15 Jun 2015, 04:06 PM

Hello,

 I am working with 2 of telerik web controls RadTreeList and RadImageEditor, the thing here is that I'm havving some trouble when using both.

First I bind my radtreelist within the database and here is when the image editor starts working, when I select a row from the radtreelist i get the ID and some information needed in order to bind information, this information includes an Image. The first time I select an Item from the radtreelist the imageEditor works fine but when I select another Item the radImageEditor does not reload the image and the displayed image is the one of the first selected item.

Can somebody help me on this please?

If more information is needed please let me know it

3 Answers, 1 is accepted

Sort by
0
Accepted
Vessy
Telerik team
answered on 18 Jun 2015, 12:03 PM
Hi Rodrigo,

A possible reason for the experienced issue could be if the browser is caching the initially loaded image. What approch are you using to load the target images from the DataBase to the ImageEditor? Are you doing it by using a MemoryStream in the ImageLoading event?

Can you open a primary support ticket and attach a simplified version of your project so we can reproduce and examine the problem on our side?

Regards,
Vessy
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Rodrigo
Top achievements
Rank 1
answered on 18 Jun 2015, 01:31 PM

HI Vessy,

I'm using a MemoryStream in Loading event.

I've solve my problem, I just have to a line in order to perform the required action

RadImageEditor1.ResetChanges(); /*this line was added*/
filename = Path.Combine(filename, image);
MemoryStream mstream = new MemoryStream(File.ReadAllBytes(filename));

Telerik.Web.UI.ImageEditor.EditableImage img = new Telerik.Web.UI.ImageEditor.EditableImage(mstream);
args.Image = img;
args.Cancel = true;
//Handle Uploaded images

if (!Object.Equals(Context.Cache.Get(Session.SessionID + "UploadedFile"), null))
{
if (radTxtEquipo.Text != "")
{
using (EditableImage image = new EditableImage((MemoryStream)Context.Cache.Remove(Session.SessionID + "UploadedFile")))
{
args.Image = image.Clone();
args.Cancel = true;
}
string fullPath = Server.MapPath("/Element/");
string nombre = RadImageEditor1.ExtractFileNameFromImageUrl();
string fileName = string.Format("element-{0}.jpg", radTxtEquipo.Text);//, DateTime.Now.ToString("yyyyMMdd-hhmmss"));
fullPath = Path.Combine(fullPath, fileName);
Telerik.Web.UI.ImageEditor.EditableImage img = args.Image;
img.Image.Save(fullPath);
RadWindowManager1.RadAlert("OK", 330, 150, "Application Alert", "alertCallBackFn");

 

Thanks in advance

 

 

0
Vessy
Telerik team
answered on 19 Jun 2015, 12:36 PM
Hi Rodrigo,

I am glad you managed to pinpoint the missing part of the ImageLoading logic and now images are loaded properly. Feel free to contact us again in case any further question on this matter occurs.

Regards,
Vessy
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
ImageEditor
Asked by
Rodrigo
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Rodrigo
Top achievements
Rank 1
Share this question
or