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

Custom Save Button

4 Answers 289 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
Ali
Top achievements
Rank 1
Ali asked on 06 Jan 2019, 07:16 PM

Hi Team.

How can I create a custom save button to save the edited Image directly into the sql sever database or use the default save button to save the image directly to the the database.

However, the only option I have right now is to save the image to file and then save image file to the database, which I want to avoid because I will end up having two save buttons.

Thank you.

4 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 07 Jan 2019, 08:57 AM
Hi Ali,

Here is how you can override the default action:
class MyImageEditor : RadImageEditor
{
    protected override RadImageEditorElement CreateImageEditorElement()
    {
        return new MyImageEditorElement();
    }
}
class MyImageEditorElement : RadImageEditorElement
{
    protected override Type ThemeEffectiveType
    {
        get
        {
            return typeof(RadImageEditorElement);
        }
    }
    public override void SaveImageAs()
    {
       //add your code
    }
}

I hope this will be useful.  

Regards,
Dimitar
Progress TelerikRadImageEditor for Winforms
0
Ali
Top achievements
Rank 1
answered on 07 Jan 2019, 12:16 PM

Hi Dimitar,

Thank you. I have implemented the code and initialize it as below:

Sub New()
        ' This call is required by the designer.
        InitializeComponent()
        Me.RadImageEditor1 = New MyImageEditor

End Sub

and on my form Load I try to create a blank bitmap image

Private Sub formImageEditor_Load(sender As Object, e As EventArgs) Handles Me.Load
            RadImageEditor1.OpenImage(New Bitmap(500, 500))
End Sub

but then it keeps opening the file open dialog when ever I try to Draw something.

Regards.

 

 

 

 

0
Ali
Top achievements
Rank 1
answered on 07 Jan 2019, 03:13 PM

Hi Dimitar,

I have resolve it. I just have to replace the RadImageEditor1 initialization directly within the designer.vb file.

e.i Me.RadImageEditor1 = New MyImageEditor()

Thank you.

0
Accepted
Dimitar
Telerik team
answered on 08 Jan 2019, 09:21 AM
Hello Ali,

Yes, this is the correct approach. Do not hesitate to contact us if you have other questions.
 
Regards,
Dimitar
Progress TelerikRadImageEditor for Winforms
Tags
ImageEditor
Asked by
Ali
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Ali
Top achievements
Rank 1
Share this question
or