Set PPI properly in schematic bitmaps, too

This commit is contained in:
Jon Evans 2023-02-14 21:36:47 -05:00
parent 5ccf205788
commit e8a88411ea
3 changed files with 10 additions and 1 deletions

View File

@ -92,6 +92,13 @@ bool SCH_BITMAP::ReadImageFile( const wxString& aFullFilename )
} }
void SCH_BITMAP::SetImage( wxImage* aImage )
{
m_image->SetImage( aImage );
m_image->SetPixelSizeIu( 254000.0 / m_image->GetPPI() );
}
EDA_ITEM* SCH_BITMAP::Clone() const EDA_ITEM* SCH_BITMAP::Clone() const
{ {
return new SCH_BITMAP( *this ); return new SCH_BITMAP( *this );

View File

@ -57,6 +57,8 @@ public:
return m_image; return m_image;
} }
void SetImage( wxImage* aImage );
/** /**
* @return the image "zoom" value. * @return the image "zoom" value.
* scale = 1.0 = original size of bitmap. * scale = 1.0 = original size of bitmap.

View File

@ -2967,7 +2967,7 @@ SCH_BITMAP* SCH_SEXPR_PARSER::parseImage()
wxImage* image = new wxImage(); wxImage* image = new wxImage();
wxMemoryInputStream istream( stream ); wxMemoryInputStream istream( stream );
image->LoadFile( istream, wxBITMAP_TYPE_PNG ); image->LoadFile( istream, wxBITMAP_TYPE_PNG );
bitmap->GetImage()->SetImage( image ); bitmap->SetImage( image );
break; break;
} }