Print bitmaps using BW setting

When selecting the "Print in B&W", all items on the schematic should be
printed using black and white.  This converts the embedded images
greyscale before outputting to the printer
This commit is contained in:
Seth Hillbrand 2019-06-17 06:54:52 -07:00
parent 8de93ad8b4
commit 77f0799750
1 changed files with 13 additions and 4 deletions

View File

@ -238,10 +238,19 @@ void BITMAP_BASE::DrawBitmap( wxDC* aDC, const wxPoint& aPos )
aDC->SetUserScale( scale * GetScalingFactor(), scale * GetScalingFactor() );
aDC->SetLogicalOrigin( logicalOriginX / GetScalingFactor(),
logicalOriginY / GetScalingFactor() );
aDC->DrawBitmap( *m_bitmap,
KiROUND( pos.x / GetScalingFactor() ),
KiROUND( pos.y / GetScalingFactor() ),
true );
if( GetGRForceBlackPenState() )
{
wxBitmap result( m_bitmap->ConvertToImage().ConvertToGreyscale() );
aDC->DrawBitmap( result, KiROUND( pos.x / GetScalingFactor() ),
KiROUND( pos.y / GetScalingFactor() ), true );
}
else
{
aDC->DrawBitmap( *m_bitmap, KiROUND( pos.x / GetScalingFactor() ),
KiROUND( pos.y / GetScalingFactor() ), true );
}
aDC->SetUserScale( scale, scale );
aDC->SetLogicalOrigin( logicalOriginX, logicalOriginY );
}