Advertisement
jsbsan

ejemploSVG

Apr 13th, 2014
1,161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
GAMBAS 1.23 KB | None | 0 0
  1. ' Gambas class file
  2.  
  3. Public Sub _new()
  4.  
  5. End
  6.  
  7. Public Sub Form_Open()
  8.  
  9.   PictureBox1.Picture = Picture.Load(Application.path & "/ejemplo.svg")
  10.   LabelSalida.text = User.home & "/ejemploRelleno.svg"
  11.  
  12. End
  13.  
  14. Public Sub ButtonRellenar_Click()
  15.  
  16.   dibujar()
  17.  
  18. End
  19.  
  20. Public Sub dibujar()
  21.  
  22.   Dim hSvgImage As SvgImage
  23.  
  24.   Try Kill User.home & "/ejemploRelleno.svg"
  25.   hSvgImage = SvgImage.Load(Application.path & "/ejemplo.svg")
  26.  
  27.   Paint.Begin(hSvgImage)
  28.  
  29.   Paint.DrawRichText("<h1> <font color=\"red\"> " & TextBoxTitulo.text & "</font></h1>", 150, 50, 200, 200)
  30.   Paint.DrawRichText("<h2><u>" & TextBoxSubtitulo.text & "</u></h2>", 150, 130, 200, 200)
  31.   Paint.LineWidth = 1
  32.   Paint.Rectangle(290, 140, 50, 50)
  33.   Paint.FillRect(310, 150, 25, 25, Color.Orange)
  34.   Paint.moveto(290, 140)
  35.   Paint.LineTo(310, 150)
  36.   Paint.MoveTo(290, 190)
  37.   Paint.LineTo(310, 175)
  38.  
  39.   Paint.Stroke()
  40.  
  41.   Paint.End
  42.  
  43.   hSvgImage.Save(User.home & "/ejemploRelleno.svg")
  44.   Wait 0.1
  45.  
  46.   PictureBox1.Picture = Picture.Load(User.home & "/ejemploRelleno.svg")
  47.  
  48. End
  49.  
  50. Public Sub ButtonLimpiar_Click()
  51.   'cargo el archivo plantilla sin modificacion
  52.  
  53.   PictureBox1.Picture = Picture.Load(Application.path & "/ejemplo.svg")
  54.  
  55. End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement