2008-04-30 05:34:15 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: dcgraph.h
|
|
|
|
// Purpose: interface of wxGCDC
|
|
|
|
// Author: wxWidgets team
|
2010-07-13 09:29:13 -04:00
|
|
|
// Licence: wxWindows licence
|
2008-04-30 05:34:15 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxGCDC
|
|
|
|
|
|
|
|
wxGCDC is a device context that draws on a wxGraphicsContext.
|
|
|
|
|
2019-06-07 11:17:10 -04:00
|
|
|
wxGCDC does its best to implement wxDC API, but the following features are
|
|
|
|
not (fully) implemented because wxGraphicsContext doesn't support them:
|
|
|
|
|
|
|
|
- GetPixel() method is not implemented and always returns @false because
|
|
|
|
modern graphics layers don't support retrieving the contents of the drawn
|
|
|
|
pixels.
|
|
|
|
|
|
|
|
- FloodFill() method is not, and can't be, implemented, as its
|
|
|
|
functionality relies on reading the pixels from wxGraphicsContext too.
|
|
|
|
|
|
|
|
- SetLogicalFunction() method only works with @c wxCOPY, @c wxOR,
|
2019-06-07 13:44:24 -04:00
|
|
|
@c wxNO_OP, @c wxCLEAR and @c wxXOR functions, attempts to use any other
|
2019-06-07 11:17:10 -04:00
|
|
|
function (including @c wxINVERT) don't do anything.
|
|
|
|
|
|
|
|
- Similarly, ::wxRasterOperationMode parameter of Blit() and StretchBlit()
|
|
|
|
can only be one of the supported logical functions listed above, using
|
|
|
|
any other function will result in an assertion failure and not drawing
|
|
|
|
anything.
|
|
|
|
|
|
|
|
- For Direct2D-based wxGraphicsContext, only true-type fonts can be used
|
|
|
|
in the font-related functions.
|
2017-04-17 12:32:31 -04:00
|
|
|
|
2008-04-30 05:34:15 -04:00
|
|
|
@library{wxcore}
|
|
|
|
@category{dc}
|
|
|
|
|
|
|
|
@see wxDC, wxGraphicsContext
|
|
|
|
*/
|
|
|
|
|
|
|
|
class wxGCDC: public wxDC
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Constructs a wxGCDC from a wxWindowDC.
|
|
|
|
*/
|
2011-09-25 00:30:49 -04:00
|
|
|
wxGCDC( const wxWindowDC& windowDC );
|
2009-01-11 07:05:05 -05:00
|
|
|
|
2008-04-30 05:34:15 -04:00
|
|
|
/**
|
|
|
|
Constructs a wxGCDC from a wxMemoryDC.
|
|
|
|
*/
|
2011-09-25 00:30:49 -04:00
|
|
|
wxGCDC( const wxMemoryDC& memoryDC );
|
2009-01-11 07:05:05 -05:00
|
|
|
|
2008-04-30 05:34:15 -04:00
|
|
|
/**
|
|
|
|
Constructs a wxGCDC from a wxPrinterDC.
|
|
|
|
*/
|
2011-09-25 00:30:49 -04:00
|
|
|
wxGCDC( const wxPrinterDC& printerDC );
|
2009-01-11 07:05:05 -05:00
|
|
|
|
2011-09-02 21:39:02 -04:00
|
|
|
/**
|
2012-11-30 19:14:31 -05:00
|
|
|
Construct a wxGCDC from an existing graphics context.
|
2018-12-05 21:43:37 -05:00
|
|
|
|
|
|
|
Note that this object takes ownership of @a context and will delete it
|
|
|
|
when it is destroyed or when SetGraphicsContext() is called with a
|
|
|
|
different context object.
|
2018-12-15 10:57:15 -05:00
|
|
|
|
|
|
|
Also notice that @a context will continue using the same font, pen and
|
|
|
|
brush as before until SetFont(), SetPen() or SetBrush() is explicitly
|
|
|
|
called to change them. This means that the code can use this
|
|
|
|
wxDC-derived object to work using pens and brushes with alpha component,
|
|
|
|
for example (which normally isn't supported by wxDC API), but it also
|
|
|
|
means that the return values of GetFont(), GetPen() and GetBrush() won't
|
|
|
|
really correspond to the actually used objects because they simply can't
|
|
|
|
represent them anyhow. If you wish to avoid such discrepancy, you need
|
|
|
|
to call the setter methods to bring wxDC and wxGraphicsContext font, pen
|
|
|
|
and brush in sync with each other.
|
2011-09-02 21:39:02 -04:00
|
|
|
*/
|
|
|
|
wxGCDC(wxGraphicsContext* context);
|
|
|
|
|
2011-07-19 18:35:41 -04:00
|
|
|
/**
|
|
|
|
Constructs a wxGCDC from a wxEnhMetaFileDC.
|
|
|
|
|
|
|
|
This constructor is only available in wxMSW port and when @c
|
|
|
|
wxUSE_ENH_METAFILE build option is enabled, i.e. when wxEnhMetaFileDC
|
|
|
|
class itself is available.
|
|
|
|
|
|
|
|
@since 2.9.3
|
|
|
|
*/
|
2011-09-25 00:30:49 -04:00
|
|
|
wxGCDC( const wxEnhMetaFileDC& emfDC );
|
2011-07-19 18:35:41 -04:00
|
|
|
|
2011-09-02 21:39:02 -04:00
|
|
|
wxGCDC();
|
|
|
|
virtual ~wxGCDC();
|
2019-01-30 11:28:08 -05:00
|
|
|
|
2008-04-30 05:34:15 -04:00
|
|
|
/**
|
|
|
|
Retrieves associated wxGraphicsContext
|
|
|
|
*/
|
2011-07-07 09:05:16 -04:00
|
|
|
wxGraphicsContext* GetGraphicsContext() const;
|
2011-09-02 21:39:02 -04:00
|
|
|
|
|
|
|
/**
|
2013-10-26 14:51:16 -04:00
|
|
|
Set the graphics context to be used for this wxGCDC.
|
2018-12-05 21:43:37 -05:00
|
|
|
|
|
|
|
Note that this object takes ownership of @a context and will delete it when
|
|
|
|
it is destroyed or when SetGraphicsContext() is called again.
|
2019-07-06 21:18:18 -04:00
|
|
|
|
|
|
|
Also, unlike the constructor taking wxGraphicsContext, this method will
|
|
|
|
reapply the current font, pen and brush, so that this object continues
|
|
|
|
to use them, if they had been changed before (which is never the case
|
|
|
|
when constructing wxGCDC directly from wxGraphicsContext).
|
2011-09-02 21:39:02 -04:00
|
|
|
*/
|
2018-12-05 21:43:37 -05:00
|
|
|
void SetGraphicsContext(wxGraphicsContext* context);
|
2011-09-02 21:39:02 -04:00
|
|
|
|
2008-04-30 05:34:15 -04:00
|
|
|
};
|
|
|
|
|