大家帮帮我完成这个东西 谢谢了
我要写个代码 用cards.dll 要求是 画4列牌 各13张 1-K
大体框架我写好了 就是绘制图片我不会 请大家帮我加上 谢谢了 我写的框架:
#include <windows.h>
#include "cards.h"
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
static TCHAR szAppName[] = TEXT ("HelloWin") ;
HWND hwnd ;
MSG msg ;
WNDCLASS wndclass ;
wndclass.style = CS_HREDRAW | CS_VREDRAW ;
wndclass.lpfnWndProc = WndProc ;
wndclass.cbClsExtra = 0 ;
wndclass.cbWndExtra = 0 ;
wndclass.hInstance = hInstance ;
wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ;
wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ;
wndclass.hbrBackground= CreateSolidBrush ( RGB(0,0x7a,0) ) ;
wndclass.lpszMenuName = NULL ;
wndclass.lpszClassName= szAppName ;
RegisterClass (&wndclass);
hwnd = CreateWindow( szAppName,
TEXT ("cards"),
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInstance,
NULL) ;
ShowWindow (hwnd, iCmdShow) ;
UpdateWindow (hwnd) ;
while (GetMessage (&msg, NULL, 0, 0))
{
TranslateMessage (&msg) ;
DispatchMessage (&msg) ;
}
return msg.wParam ;
}
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hdc ;
PAINTSTRUCT ps ;
switch (message)
{
case WM_CREATE:
return 0 ;
case WM_PAINT:
hdc = BeginPaint (hwnd, &ps) ;
EndPaint (hwnd, &ps) ;
return 0 ;
case WM_DESTROY:
PostQuitMessage (0) ;
return 0 ;
}
return DefWindowProc (hwnd, message, wParam, lParam) ;
}
cards.h文件:
#define mdFace 0 /* Draw card face up, card to draw specified by cd */
#define mdBackground 1 /* Draw card face down, back specified by cd (cdBackgroundFirst..cdBackgroundLast) */
#define mdHilite 2 /* Same as FaceUp except drawn with NOTSRCCOPY mode */
#define mdGhost 3 /* Draw a ghost card -- for ace piles */
#define mdRemove 4 /* draw background specified by rgbBgnd */
#define mdInvisibleGhost 5 /* ? */
#define mdDeckX 6 /* Draw X */
#define mdDeckO 7 /* Draw O */`
#define cdAClubs 0
#define cd2Clubs 4
#define cd3Clubs 8
#define cd4Clubs 12
#define cd5Clubs 16
#define cd6Clubs 20
#define cd7Clubs 24
#define cd8Clubs 28
#define cd9Clubs 32
#define cdTClubs 36
#define cdJClubs 40
#define cdQClubs 44
#define cdKClubs 48
#define cdADiamonds 1
#define cd2Diamonds 5
#define cd3Diamonds 9
#define cd4Diamonds 13
#define cd5Diamonds 17
#define cd6Diamonds 21
#define cd7Diamonds 25
#define cd8Diamonds 29
#define cd9Diamonds 33
#define cdTDiamonds 37
#define cdJDiamonds 41
#define cdQDiamonds 45
#define cdKDiamonds 49
#define cdAHearts 2
#define cd2Hearts 6
#define cd3Hearts 10
#define cd4Hearts 14
#define cd5Hearts 18
#define cd6Hearts 22
#define cd7Hearts 26
#define cd8Hearts 30
#define cd9Hearts 34
#define cdTHearts 38
#define cdJHearts 42
#define cdQHearts 46
#define cdKHearts 50
#define cdASpades 3
#define cd2Spades 7
#define cd3Spades 11
#define cd4Spades 15
#define cd5Spades 19
#define cd6Spades 23
#define cd7Spades 27
#define cd8Spades 31
#define cd9Spades 35
#define cdTSpades 39
#define cdJSpades 43
#define cdQSpades 47
#define cdKSpades 51
#define cdBackground1 54
#define cdBackground2 55
#define cdBackground3 56
#define cdBackground4 57
#define cdBackground5 58
#define cdBackground6 59
#define cdBackground7 60
#define cdBackground8 61
#define cdBackground9 62
#define cdBackground10 63
#define cdBackground11 64
#define cdBackground12 65
#define cdBackgroundFirst cdBackground1
#define cdBackgroundLast cdBackground12
BOOL WINAPI cdtInit(int FAR *pdxCard, int FAR *pdyCard);
BOOL WINAPI cdtDraw(HDC hdc, int x, int y, int cd, int md, DWORD rgbBgnd);
BOOL WINAPI cdtDrawExt(HDC hdc, int x, int y, int dx, int dy,
int cd, int md, DWORD rgbBgnd);
BOOL WINAPI cdtAnimate(HDC hdc, int cd, int x, int y, int ispr);
VOID WINAPI cdtTerm(VOID);