#include "wx/private/graphics.h"
#include "wx/msw/wrapgdip.h"
#include "wx/msw/dc.h"
-#include "wx/msw/enhmeta.h"
+#if wxUSE_ENH_METAFILE
+ #include "wx/msw/enhmeta.h"
+#endif
#include "wx/dcgraph.h"
#include "wx/msw/private.h" // needs to be before #include <commdlg.h>
wxBitmap* bmp = pen.GetStipple();
if ( bmp && bmp->Ok() )
{
- m_penImage = Bitmap::FromHBITMAP((HBITMAP)bmp->GetHBITMAP(),(HPALETTE)bmp->GetPalette()->GetHPALETTE());
+ m_penImage = Bitmap::FromHBITMAP((HBITMAP)bmp->GetHBITMAP(),
+#if wxUSE_PALETTE
+ (HPALETTE)bmp->GetPalette()->GetHPALETTE()
+#else
+ NULL
+#endif
+ );
m_penBrush = new TextureBrush(m_penImage);
m_pen->SetBrush( m_penBrush );
}
if ( bmp && bmp->Ok() )
{
wxDELETE( m_brushImage );
- m_brushImage = Bitmap::FromHBITMAP((HBITMAP)bmp->GetHBITMAP(),(HPALETTE)bmp->GetPalette()->GetHPALETTE());
+ m_brushImage = Bitmap::FromHBITMAP((HBITMAP)bmp->GetHBITMAP(),
+#if wxUSE_PALETTE
+ (HPALETTE)bmp->GetPalette()->GetHPALETTE()
+#else
+ NULL
+#endif
+ );
m_brush = new TextureBrush(m_brushImage);
}
}
Bitmap* image = NULL;
if ( bmp.GetMask() )
{
- Bitmap interim((HBITMAP)bmp.GetHBITMAP(),(HPALETTE)bmp.GetPalette()->GetHPALETTE()) ;
+ Bitmap interim((HBITMAP)bmp.GetHBITMAP(),
+#if wxUSE_PALETTE
+ (HPALETTE)bmp.GetPalette()->GetHPALETTE()
+#else
+ NULL
+#endif
+ );
size_t width = interim.GetWidth();
size_t height = interim.GetHeight();
}
else
{
- image = Bitmap::FromHBITMAP((HBITMAP)bmp.GetHBITMAP(),(HPALETTE)bmp.GetPalette()->GetHPALETTE());
+ image = Bitmap::FromHBITMAP((HBITMAP)bmp.GetHBITMAP(),
+#if wxUSE_PALETTE
+ (HPALETTE)bmp.GetPalette()->GetHPALETTE()
+#else
+ NULL
+#endif
+ );
if ( bmp.HasAlpha() && GetPixelFormatSize(image->GetPixelFormat()) == 32 )
{
size_t width = image->GetWidth();
// add the rotation to this matrix (radians)
void wxGDIPlusMatrixData::Rotate( wxDouble angle )
{
- m_matrix->Rotate( angle );
+ m_matrix->Rotate( RadToDeg(angle) );
}
//
virtual wxGraphicsContext * CreateContext( const wxMemoryDC& dc);
+#if wxUSE_PRINTING_ARCHITECTURE
virtual wxGraphicsContext * CreateContext( const wxPrinterDC& dc);
+#endif
+#if wxUSE_ENH_METAFILE
virtual wxGraphicsContext * CreateContext( const wxEnhMetaFileDC& dc);
+#endif
virtual wxGraphicsContext * CreateContextFromNativeContext( void * context );
return new wxGDIPlusContext(this,(HDC) msw->GetHDC(), sz.x, sz.y);
}
+#if wxUSE_PRINTING_ARCHITECTURE
wxGraphicsContext * wxGDIPlusRenderer::CreateContext( const wxPrinterDC& dc)
{
ENSURE_LOADED_OR_RETURN(NULL);
wxSize sz = dc.GetSize();
return new wxGDIPlusContext(this,(HDC) msw->GetHDC(), sz.x, sz.y);
}
+#endif
+#if wxUSE_ENH_METAFILE
wxGraphicsContext * wxGDIPlusRenderer::CreateContext( const wxEnhMetaFileDC& dc)
{
ENSURE_LOADED_OR_RETURN(NULL);
wxSize sz = dc.GetSize();
return new wxGDIPlusContext(this,(HDC) msw->GetHDC(), sz.x, sz.y);
}
+#endif
wxGraphicsContext * wxGDIPlusRenderer::CreateContext( const wxMemoryDC& dc)
{