Guidance
指路人
g.yi.org
software / rapidq / Examples / Game / cards / showCards.bas

Register 
新用户注册
Search 搜索
首页 
Home Home
Software
Upload

  
' showCards.bas for RapidQ
' Coded by Gérald VERDIER - BinoclaR (°-°) software
' june 2004
' email : gerald.verdier@club-internet.fr
' PURPOSE : small code to show a card from (cards32.dll or cards.dll)
     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)
       'cc=cdtDrawExt (image.handle, 0 ,0 ,l/2 ,h/2 ,crt ,&h0 ,&hff00ff) = for different size
      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




掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Fri 2019-4-26  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2004-06-08 05:15:15