Click here to Skip to main content
15,881,600 members
Articles / Desktop Programming / MFC

Drawing with DirectDraw & GDI

Rate me:
Please Sign up or sign in to vote.
4.88/5 (11 votes)
24 May 2002 300K   13.8K   68  
Drawing Graphics fast with DirectDraw than with GDI
[
    uuid(98256279-35C8-434A-B4A8-4760063EFAD5)
]
interface CCanvasImpl
{
    [

]HRESULT Create([

] CDXScreen* pScreen,[

] LONG lSize,[

] CHAR* lpCache,[

] BYTE memoryType);
    [

]HRESULT PutPixel([

] int X,[

] int Y,[

] DWORD Col);
    [

]HRESULT GetPixel([

] int X,[

] int Y);
    [

]HRESULT Rect([

] int X1,[

] int Y1,[

] int X2,[

] int Y2,[

] DWORD Col);
    [

]HRESULT FillRect([

] int X1,[

] int Y1,[

] int X2,[

] int Y2,[

] DWORD Col);
    [

]HRESULT Line([

] int X1,[

] int Y1,[

] int X2,[

] int Y2,[

] DWORD Col);
    [

]HRESULT Circle([

] int X,[

] int Y,[

] int Radius,[

] DWORD Col);
    [

]HRESULT FillCircle([

] int X,[

] int Y,[

] int Radius,[

] DWORD Col);
    [

]HRESULT RoundedRect([

] int X1,[

] int Y1,[

] int X2,[

] int Y2,[

] int Radius,[

] DWORD Col);
    [

]HRESULT Fill([

] DWORD FillColor);
    [

]HRESULT TextOut([

] int x,[

] int y,[

] COLORREF col,[

] LPCTSTR pString);
    [

]HRESULT DrawText([

] LPCSTR pString,[

] COLORREF col,[

] LPRECT pRect);
    [

]HRESULT SaveAsBMP([

] const char* szFilename);
    [

]HRESULT Blt([

] CDXSurface* lpCDXS,[

] LONG* lDestX,[

] LONG* lDestY,[

] RECT* srcRect);
    [

]HRESULT ClipRect([

] RECT* Rect);
    [

]HRESULT Restore();
    [

]HRESULT ChangeFont([

] const char* FontName,[

] int Width,[

] int Height,[

] int Attributes);
    [

]HRESULT SetFont();
    [

]HRESULT Lock();
    [

]HRESULT UnLock();
    [

]HRESULT GetDC();
    [

]HRESULT ReleaseDC();
    [

]HRESULT GetWidth();
    [

]HRESULT GetHeight();
    [

]HRESULT GetSurfacePointer();
    [

]HRESULT GetClipRect();
    [

]HRESULT SetClipRect([

] RECT* clipRect);
    [

]HRESULT GetFontName([

] char* name);
    [

]HRESULT GetSurfaceDescriptor([

] LPDDSURFACEDESC2 lpddsd);
    [

]HRESULT GetDDS();
    [

]HRESULT Refresh([

] RECT* pRect);
};
[
    uuid(46D36998-857D-4A63-9C91-F84B1DB6DC39),
    version(1.0)
]
library DRAWINGLib
{
    };

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
China China
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions