Drawing cards from cards.dll? 
Author Message
 Drawing cards from cards.dll?

Followed this example from
http://www.*-*-*.com/ , pretty cool.  Just
wondering though:

this example draws the cards directly on the form.  How can I draw the
cards to a picture box so that I can drag-n-drop, etc.?

(BTW, the example is in 16-bit VB... will use 32-bit eventually)

' The line that draws the card
ret% = CdtDraw(hdc, Xleft%, 0, i, C_FACES, &HFFFF&)

' The declaration
 'CdtDraw used to draw a card with the default size
 'at a specified location in a form, picture box or whatever.
 'It can draw any of the 52 faces an 13 different Back designs,
 'as well as pile markers such as the X and O. Cards can also
 'be drawn in the negative image, eg to show selection.
 'xOrg = x origin in pixels 'yOrg = y origin in pixels
 'nCard = one of the Card Back constants or a card number 0 to 51
 'nDraw = one of the Action constants 'nColor = The highlight color
 Declare Function CdtDraw Lib "CARDS.DLL" (ByVal hDC As Integer, ByVal
xOrg As Integer, ByVal yOrg As Integer, ByVal nCard As Integer, ByVal
nDraw As Integer, ByVal nColor&) As Integer



Tue, 29 May 2001 03:00:00 GMT  
 Drawing cards from cards.dll?
You can draw the card in a picturebox by using
the picturebox's hdc . In the code where you see
hdc ,ret% = CdtDraw(hdc, Xleft%, 0, i, C_FACES, &HFFFF&),
use the picture1.hdc instead of the form's hdc .

    Also , I think Cards.dll is a 16 bit dll and cannot be
used with 32bit VB .

        Bri

Quote:

>Followed this example from
>http://pages.prodigy.com/MO/vbsite/vb020596.html, pretty cool.  Just
>wondering though:

>this example draws the cards directly on the form.  How can I draw the
>cards to a picture box so that I can drag-n-drop, etc.?

>(BTW, the example is in 16-bit VB... will use 32-bit eventually)

>' The line that draws the card
>ret% = CdtDraw(hdc, Xleft%, 0, i, C_FACES, &HFFFF&)

>' The declaration
> 'CdtDraw used to draw a card with the default size
> 'at a specified location in a form, picture box or whatever.
> 'It can draw any of the 52 faces an 13 different Back designs,
> 'as well as pile markers such as the X and O. Cards can also
> 'be drawn in the negative image, eg to show selection.
> 'xOrg = x origin in pixels 'yOrg = y origin in pixels
> 'nCard = one of the Card Back constants or a card number 0 to 51
> 'nDraw = one of the Action constants 'nColor = The highlight color
> Declare Function CdtDraw Lib "CARDS.DLL" (ByVal hDC As Integer, ByVal
>xOrg As Integer, ByVal yOrg As Integer, ByVal nCard As Integer, ByVal
>nDraw As Integer, ByVal nColor&) As Integer



Tue, 29 May 2001 03:00:00 GMT  
 Drawing cards from cards.dll?
Thanks, dude.  That did the trick.

You're right about cards.dll being 16-bit, but there is a
"cards32.dll" that comes with Windows NT and I'm hoping that the API
calls will be easy enough to transfer.... ;0



Quote:
>You can draw the card in a picturebox by using
>the picturebox's hdc . In the code where you see
>hdc ,ret% = CdtDraw(hdc, Xleft%, 0, i, C_FACES, &HFFFF&),
>use the picture1.hdc instead of the form's hdc .

>    Also , I think Cards.dll is a 16 bit dll and cannot be
>used with 32bit VB .



Wed, 30 May 2001 03:00:00 GMT  
 Drawing cards from cards.dll?

Quote:

> You can draw the card in a picturebox by using
> the picturebox's hdc . In the code where you see
> hdc ,ret% = CdtDraw(hdc, Xleft%, 0, i, C_FACES, &HFFFF&),
> use the picture1.hdc instead of the form's hdc .

>     Also , I think Cards.dll is a 16 bit dll and cannot be
> used with 32bit VB .

>         Bri


> >Followed this example from
> >http://pages.prodigy.com/MO/vbsite/vb020596.html, pretty cool.  Just
> >wondering though:

> >this example draws the cards directly on the form.  How can I draw the
> >cards to a picture box so that I can drag-n-drop, etc.?

> >(BTW, the example is in 16-bit VB... will use 32-bit eventually)

> >' The line that draws the card
> >ret% = CdtDraw(hdc, Xleft%, 0, i, C_FACES, &HFFFF&)

> >' The declaration
> > 'CdtDraw used to draw a card with the default size
> > 'at a specified location in a form, picture box or whatever.
> > 'It can draw any of the 52 faces an 13 different Back designs,
> > 'as well as pile markers such as the X and O. Cards can also
> > 'be drawn in the negative image, eg to show selection.
> > 'xOrg = x origin in pixels 'yOrg = y origin in pixels
> > 'nCard = one of the Card Back constants or a card number 0 to 51
> > 'nDraw = one of the Action constants 'nColor = The highlight color
> > Declare Function CdtDraw Lib "CARDS.DLL" (ByVal hDC As Integer, ByVal
> >xOrg As Integer, ByVal yOrg As Integer, ByVal nCard As Integer, ByVal
> >nDraw As Integer, ByVal nColor&) As Integer

Goto http://www.cgvb.com/links/lpage.boa/FILE and look for QCARD32.zip
It will do all you need, and comes with a help file. I've played with
it.


Sat, 02 Jun 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. CARDS.BAS - VB Declares for CARDS.DLL

2. Access Playing Cards Images (CARDS.DLL)

3. Programming radio card and tv card

4. Sound Card <-> Sound Card Via Data

5. deVBuzz.com winners announced - new draw - 3 x 32MB CF cards

6. How can I get access to a DLL file, for example CARDS.DLL

7. Cards.dll

8. cards.dll

9. PictureBox and cards.dll

10. Cards.dll

11. REQ: Need a 32bit DLL or OCX for Playing cards

12. Does anybody know the dll used for useing the cards like in solitare

 

 
Powered by phpBB® Forum Software