diff --git a/eeschema/sch_bitmap.cpp b/eeschema/sch_bitmap.cpp index 7a6d51d661..d1b8f09ed9 100644 --- a/eeschema/sch_bitmap.cpp +++ b/eeschema/sch_bitmap.cpp @@ -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 { return new SCH_BITMAP( *this ); diff --git a/eeschema/sch_bitmap.h b/eeschema/sch_bitmap.h index 3c0e5844ce..7285b78d0d 100644 --- a/eeschema/sch_bitmap.h +++ b/eeschema/sch_bitmap.h @@ -57,6 +57,8 @@ public: return m_image; } + void SetImage( wxImage* aImage ); + /** * @return the image "zoom" value. * scale = 1.0 = original size of bitmap. diff --git a/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp b/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp index d33c68e554..1045e381a8 100644 --- a/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp +++ b/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp @@ -2967,7 +2967,7 @@ SCH_BITMAP* SCH_SEXPR_PARSER::parseImage() wxImage* image = new wxImage(); wxMemoryInputStream istream( stream ); image->LoadFile( istream, wxBITMAP_TYPE_PNG ); - bitmap->GetImage()->SetImage( image ); + bitmap->SetImage( image ); break; }