Advertisement
jsbsan

Dibujando Zonas de Imagenes

Apr 16th, 2014
1,117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
GAMBAS 0.82 KB | None | 0 0
  1. ' Gambas class file
  2.  
  3. Private img_cards As Image = Image.Load("barajaespanola.png")
  4. Private CARD_S_W As Integer = img_cards.W / 10 'numero de columnas
  5. Private CARD_S_H As Integer = img_cards.H / 4 'numero de filas
  6.  
  7. Public Sub SpinBoxColumna_Change()
  8.  
  9.   DrawingArea1.Refresh() 'se ha producido un cambio en el spin, y refrescamos el drawingArea, y asi se redibuja
  10.  
  11. End
  12.  
  13. Public Sub SpinBoxFila_Change()
  14.  
  15.   DrawingArea1.Refresh() 'se ha producido un cambio en el spin, y refrescamos el drawingArea, y asi se redibuja
  16.  
  17. End
  18.  
  19. Public Sub DrawingArea1_Draw()
  20.  
  21.   dibujaCarta(SpinBoxColumna.value, SpinBoxFila.Value)
  22.  
  23. End
  24.  
  25. Public Sub dibujaCarta(x As Integer, y As Integer)
  26.  
  27.   Paint.DrawImage(img_cards, 0, 0, CARD_S_W, CARD_S_H, 1, Rect((X - 1) * CARD_S_W, (Y - 1) * CARD_S_H, CARD_S_W, CARD_S_H))
  28.  
  29. End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement