adding alpha to core graphics dc

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40837 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2006-08-26 13:35:08 +00:00
parent fa8bc37bc2
commit 83b445a666

View File

@@ -552,8 +552,8 @@ void wxMacCGContext::SetPen( const wxPen &pen )
if ( stroke ) if ( stroke )
{ {
RGBColor col = MAC_WXCOLORREF( pen.GetColour().GetPixel() ) ; CGContextSetRGBStrokeColor( m_cgContext , pen.GetColour().Red() / 255.0 , pen.GetColour().Green() / 255.0 ,
CGContextSetRGBStrokeColor( m_cgContext , col.red / 65536.0 , col.green / 65536.0 , col.blue / 65536.0 , 1.0 ) ; pen.GetColour().Blue() / 255.0 , pen.GetColour().Alpha() / 255.0 ) ;
// TODO: * m_dc->m_scaleX // TODO: * m_dc->m_scaleX
CGFloat penWidth = pen.GetWidth(); CGFloat penWidth = pen.GetWidth();
@@ -678,8 +678,8 @@ void wxMacCGContext::SetPen( const wxPen &pen )
CGContextSetStrokeColorSpace( m_cgContext , patternSpace ) ; CGContextSetStrokeColorSpace( m_cgContext , patternSpace ) ;
wxMacCFRefHolder<CGPatternRef> pattern( *( new HatchPattern( pen.GetStyle() , CGContextGetCTM( m_cgContext ) ) ) ); wxMacCFRefHolder<CGPatternRef> pattern( *( new HatchPattern( pen.GetStyle() , CGContextGetCTM( m_cgContext ) ) ) );
RGBColor col = MAC_WXCOLORREF( pen.GetColour().GetPixel() ) ; CGFloat colorArray[4] = { pen.GetColour().Red() / 255.0 , pen.GetColour().Green() / 255.0 ,
CGFloat colorArray[4] = { col.red / 65536.0 , col.green / 65536.0 , col.blue / 65536.0 , 1.0 } ; pen.GetColour().Blue() / 255.0 , pen.GetColour().Alpha() / 255.0 } ;
CGContextSetStrokePattern( m_cgContext, pattern , colorArray ) ; CGContextSetStrokePattern( m_cgContext, pattern , colorArray ) ;
} }
@@ -731,8 +731,8 @@ void wxMacCGContext::SetBrush( const wxBrush &brush )
{ {
if ( brush.GetStyle() == wxSOLID ) if ( brush.GetStyle() == wxSOLID )
{ {
RGBColor col = MAC_WXCOLORREF( brush.GetColour().GetPixel() ) ; CGContextSetRGBFillColor( m_cgContext , brush.GetColour().Red() / 255.0 , brush.GetColour().Green() / 255.0 ,
CGContextSetRGBFillColor( m_cgContext , col.red / 65536.0 , col.green / 65536.0 , col.blue / 65536.0 , 1.0 ) ; brush.GetColour().Blue() / 255.0 , brush.GetColour().Alpha() / 255.0 ) ;
} }
else if ( brush.IsHatch() ) else if ( brush.IsHatch() )
{ {
@@ -740,8 +740,8 @@ void wxMacCGContext::SetBrush( const wxBrush &brush )
CGContextSetFillColorSpace( m_cgContext , patternSpace ) ; CGContextSetFillColorSpace( m_cgContext , patternSpace ) ;
wxMacCFRefHolder<CGPatternRef> pattern( *( new HatchPattern( brush.GetStyle() , CGContextGetCTM( m_cgContext ) ) ) ); wxMacCFRefHolder<CGPatternRef> pattern( *( new HatchPattern( brush.GetStyle() , CGContextGetCTM( m_cgContext ) ) ) );
RGBColor col = MAC_WXCOLORREF( brush.GetColour().GetPixel() ) ; CGFloat colorArray[4] = { brush.GetColour().Red() / 255.0 , brush.GetColour().Green() / 255.0 ,
CGFloat colorArray[4] = { col.red / 65536.0 , col.green / 65536.0 , col.blue / 65536.0 , 1.0 } ; brush.GetColour().Blue() / 255.0 , brush.GetColour().Alpha() / 255.0 } ;
CGContextSetFillPattern( m_cgContext, pattern , colorArray ) ; CGContextSetFillPattern( m_cgContext, pattern , colorArray ) ;
} }