Hi Vessy,
Great! Thanks! You are of great help.
But there is still some queries that I would like to understand.
In the attached I tried to download the image but it is giving me an error.
how can I remove the download image option in the dialog?
How can I not show the dialog box when I click on pencil or save? I would like the default to be used by the user. For example, When user select pencil, they cannot choose the color as well as the size ( the dialog box will be hidden). Same for the Save, When user click on save, I want it to be auto select save to server and automatically goes to my code behind.
Is there a way to do the above?
In below code(refer to line 26), I need to get the image type to store in the database. Currently I have to hard code the image type. May I ask how do I get the imagetype from the EditableImage?
01.
protected
void
RadImageEditor_ImageSaving(
object
sender, ImageEditorSavingEventArgs args)
02.
{
03.
04.
Telerik.Web.UI.ImageEditor.EditableImage img = args.Image;
05.
06.
MemoryStream ms =
new
MemoryStream();
07.
08.
img.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
09.
10.
byte
[] imageFile = ms.ToArray();
11.
int
fileLength = imageFile.Length;
12.
13.
//your logic for DB saving here
14.
if
(fileLength == 0)
15.
{
16.
lblError6.Text =
"Error! No file to Upload"
;
17.
}
18.
else
if
(fileLength > 5 * (1024 * 1024))
//max 5MB
19.
{
20.
lblError6.Text =
"Error!"
+
"File size ("
+ fileLength / (1024 * 1024) +
"mB) more than 5MB"
;
21.
}
22.
else
23.
{
24.
ms.Read(imageFile, 0, fileLength);
25.
string
fileName =
"Signature"
;
26.
string
fileType =
"image/x-png"
;
27.
string
jbId = ViewState[
"jbId"
].ToString();
28.
//insert into DB
29.
}
30.
}