Drawing cards from cards.dll?
Author |
Message |
Doug #1 / 4
|
 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 |
|
 |
Bri #2 / 4
|
 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 |
|
 |
Doug #3 / 4
|
 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 |
|
 |
Alex. Nitulesc #4 / 4
|
 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 |
|
|
|