VB.NET, cards.dll, PictureBox 
Author Message
 VB.NET, cards.dll, PictureBox

I'm using VB.NET and want to use cards.dll (32-bit version) to render cards
onto various PictureBox controls.

I'm having a{*filter*}ens of a time getting a device context from a PictureBox in
order to make the DLL call work. I tried to use the API call GetDC using the
PictureBox .Handle property, but that didn't work.

Any advice as to how to get a DC for a PictureBox would be greatly
appreciated!
Declare Function GetDC Lib "user32" (ByVal hwnd As IntPtr) As Long

Declare Function cdtDraw Lib "Cards32.Dll" (ByVal hdc As Long, ByVal X As
Long, ByVal Y As Long, ByVal cardValue As Long, ByVal cardSuit As Long,
ByVal rgbColor As Long) As Boolean

...

cdtDraw(GetDC(pbxCPUCard1.Handle), 0, 0, CardBack, CPU.Hand(0).Suit, 0) <-
does nothing



Fri, 25 Feb 2005 03:12:34 GMT  
 VB.NET, cards.dll, PictureBox

Quote:
> I'm using VB.NET and want to use cards.dll (32-bit version) to render
cards
> onto various PictureBox controls.

> I'm having a{*filter*}ens of a time getting a device context from a PictureBox
in
> order to make the DLL call work. I tried to use the API call GetDC using
the
> PictureBox .Handle property, but that didn't work.

<snip>

Try the .hDC property if it exists in VB.NET if not then try asking the
question in a .NET newsgroup, this is not.
Also if you want to use GetDC then you should really enable the AutoRedraw
property as it does some strange stuff in the background with it's internal
Bitmaps, and always remember to pair up your GetDC call with one to
ReleaseDC()
Hope this helps,

    Mike

 -- EDais --

 - Microsoft Visual Basic MVP -
WWW: http://www.*-*-*.com/




Fri, 25 Feb 2005 04:47:28 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. VB.NET, cards.dll, PictureBox

2. PictureBox and cards.dll

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

4. VB.NET DLL's With A VB.NET App

5. Drawing cards from cards.dll?

6. Access Playing Cards Images (CARDS.DLL)

7. Wild Card search in VB .NET

8. VB.NET & IVR Cards

9. Debug VB.NET DLL(Class Library) from ASP.NET page

10. VB.NEt 2003 and Picturebox not allow .TIF in Property Window

11. Stop an animated gif in vb.net picturebox

12. Custom Graph Control using PictureBox using VB.NET

 

 
Powered by phpBB® Forum Software