You are on page 1of 1

Private Sub Guardar_Clic (ByVal sender As System.Object, ByVal e As System.E ventArgs) Handles MenuItem11.

Clic Static Contador As Short = 1 Try With SaveFileDialog1 .Filter = "Archivo XML|*.xml|Metaarchivo|*.emf" Dim s() As String = Split(PG1.SelectedObject.GetType.ToString, " .") .FileName = s(s.GetUpperBound(0)) & Contador : Contador += 1 Dim r As DialogResult = .ShowDialog If r = DialogResult.OK Then Select Case GetExtension(.FileName) Case ".emf" Dim mf As New Metafile(.FileName, Lienzo.GetHdc) Dim mg As Graphics = Graphics.FromImage(mf) Select Case Hoja.Utensilio Case DrawingInfo.Tool.Lpiz mg.DrawPath(Hoja.Lpiz, Hoja.Trayecto) Case DrawingInfo.Tool.Pincel mg.FillPath(Hoja.Pincel, Hoja.Trayecto) End Select mf.Dispose() Case ".xml" Dim srz As New SoapSerializator() 'srz.SerializeObject(CType(PG1.SelectedObject, Curva Especial), .FileName) srz.SerializeObject(PG1.SelectedObject, .FileName) End Select End If End With Catch x As Exception MessageBox.Show(x.ToString) End Try End Sub

You might also like