Hello all,
i have a picturebox control where the user can draw something. There is a save button which should save the image drawn in the picturebox. This is the code for the save button. I am using common dialog box and using save dialog box available from it. Also, i have used the SavePicture method just like Loadpicture method. But i am getting runtime error...

Private Sub save_Click()
Dim FileName As String

cdlg.DefaultExt = "jpg"
cdlg.FileName = "untitled.jpg"
cdlg.Filter = "JPEG files (*.jpg)|*.JPG"
cdlg.InitDir = App.Path
cdlg.DialogTitle = "File save"
cdlg.ShowSave
FileName = cdlg.FileName
SavePicture(picCanvas.Picture, FileName) = picCanvas.Picture




End Sub