Code: (Select All)
Screen _NewImage(800, 600, 32)
Dim Shared CardDeck As Long
CardDeck = _LoadImage("PlayingCards.png")
If CardDeck = -1 Then Print "PlayingCards.png failed to load, bye.": End
_Source CardDeck
_ClearColor Point(0, 0), CardDeck 'set background to transparent
_Source 0
ShowCard 0, 0, 0, 0 'ace of hearts is first top left corner of image
' king of spades below
ShowCard 0, 101, 12, 3
' 9 of diamonds under
ShowCard 0, 202, 8, 2
Sub ShowCard (x, y, h, v) 'screen x, y h= horizontal , v =vertical image h, v
' 4 (0 to 3) rows across for Ace to King 0 to 12 cards
' hearts 1st row then clubs, diamonds then spades with 2 jokers in row 5
' image size of card is 38 x 51
ch = 38 * h + 1: cv = 51 * v + 1
'step doubles size of cards from image
_PutImage (x, y)-Step(76, 102), CardDeck, 0, (ch, cv)-(ch + 37, cv + 50)
End Sub
b = b + ...