DIM l AS LONG
DIM h AS LONG
DECLARE FUNCTION cdtDrawExt LIB "Cards" ALIAS "cdtDrawExt" (hdc AS LONG, X AS LONG, Y AS LONG, dx AS LONG, dy AS LONG, ordCard AS LONG, iDraw AS LONG, clr AS LONG) AS LONG
DECLARE FUNCTION cdtDraw LIB "Cards" ALIAS "cdtDraw" ( hDC AS LONG, x AS LONG, y AS LONG, nCard AS LONG, nDraw AS LONG, nColor AS LONG) AS LONG
DECLARE FUNCTION cdtTerm LIB "Cards" ALIAS "cdtTerm" ()AS LONG
DECLARE FUNCTION cdtInit LIB "Cards" ALIAS "cdtInit" (byref nWidth AS LONG, byref nHeight AS LONG) AS LONG
CONST cdt_FACE =&H0
CONST cdt_BACK =&H1
CONST cdt_INVERT =&H2
CONST cdt_CROSS =53
CONST cdt_MOSAIC1 =54
CONST cdt_MOSAIC2 =55
CONST cdt_ROBOT =56
CONST cdt_ROSE =57
CONST cdt_FLOWERS1 =58
CONST cdt_FLOWERS2 =59
CONST cdt_FISH1 =60
CONST cdt_FISH2 =61
CONST cdt_SHELL =62
CONST cdt_CASTLE =63
CONST cdt_ISLAND =64
CONST cdt_CARDHAND =65
CONST cdt_X =67
CONST cdt_O =68
DECLARE SUB Cards
DECLARE SUB the_end
CREATE frm AS QFORM
CAPTION = "show a card"
OnClick = cards
width = 200
height = 200
center
OnKeyDown = the_end
CREATE image AS QCANVAS
top = 10
height =100
width = 100
left = 10
END CREATE
CREATE clic AS QBUTTON
CAPTION = "Card ?"
top = 100
left = 100
width = 50
OnClick = cards
END CREATE
END CREATE
SUB cards
crt = INT(RND*51)+1
ci=cdtInit(l,h)
c=cdtDraw (image.handle, 0 ,0 ,crt ,cdt_BACK ,RGB(255,0,255))
clic.CAPTION = "# " + STR$(crt)
END SUB
SUB the_end
cdtTerm
frm.CLOSE
application.terminate
END SUB
frm.SHOWMODAL
|