virtual ~wxGDIPlusContext();
virtual void Clip( const wxRegion ®ion );
+ // clips drawings to the rect
+ virtual void Clip( wxDouble x, wxDouble y, wxDouble w, wxDouble h );
+
+ // resets the clipping to original extent
+ virtual void ResetClip();
+
+ virtual void * GetNativeContext();
+
virtual void StrokePath( const wxGraphicsPath *p );
virtual void FillPath( const wxGraphicsPath *p , int fillStyle = wxWINDING_RULE );
{
gGDILoader.EnsureIsLoaded();
m_context = new Graphics( (HDC) hdc);
+ m_context->SetSmoothingMode(SmoothingModeHighQuality);
m_state1 = m_context->Save();
m_state2 = m_context->Save();
void wxGDIPlusContext::Clip( const wxRegion & WXUNUSED(region) )
{
-// ClipCGContextToRegion ( m_context, &bounds , (RgnHandle) dc->m_macCurrentClipRgn );
+// TODO
+}
+
+void wxGDIPlusContext::Clip( wxDouble x, wxDouble y, wxDouble w, wxDouble h )
+{
+// TODO
+}
+
+void wxGDIPlusContext::ResetClip()
+{
+// TODO
}
void wxGDIPlusContext::StrokePath( const wxGraphicsPath *p )
void wxGDIPlusContext::Rotate( wxDouble angle )
{
- m_context->RotateTransform( angle );
+ m_context->RotateTransform( RadToDeg(angle) );
}
void wxGDIPlusContext::Translate( wxDouble dx , wxDouble dy )
void wxGDIPlusContext::Scale( wxDouble xScale , wxDouble yScale )
{
- PointF penWidth( m_pen->GetWidth(), 0);
- Matrix matrix ;
- if ( !m_penTransparent )
- {
- m_context->GetTransform(&matrix);
- matrix.TransformVectors(&penWidth);
- }
m_context->ScaleTransform(xScale,yScale);
- if ( !m_penTransparent )
- {
- m_context->GetTransform(&matrix);
- matrix.Invert();
- matrix.TransformVectors(&penWidth) ;
- m_pen->SetWidth( sqrt( penWidth.X*penWidth.X + penWidth.Y*penWidth.Y));
- }
}
void wxGDIPlusContext::PushState()
m_font = new Font( s , size , style );
}
+void* wxGDIPlusContext::GetNativeContext()
+{
+ return m_context;
+}
+
wxGraphicsContext* wxGraphicsContext::Create( const wxWindowDC& dc)
{
return new wxGDIPlusContext( (HDC) dc.GetHDC() );
}
+wxGraphicsContext* wxGraphicsContext::Create( wxWindow * window )
+{
+ return NULL; // TODO
+}
+
+wxGraphicsContext* wxGraphicsContext::CreateFromNative( void * context )
+{
+ return NULL; // TODO
+}
+
+
#endif // wxUSE_GRAPHICS_CONTEXT