diff --git a/eeschema/sch_bitmap.cpp b/eeschema/sch_bitmap.cpp index b900aa7529..0f1ca31175 100644 --- a/eeschema/sch_bitmap.cpp +++ b/eeschema/sch_bitmap.cpp @@ -92,6 +92,19 @@ bool SCH_BITMAP::ReadImageFile( const wxString& aFullFilename ) } +bool SCH_BITMAP::ReadImageFile( wxMemoryBuffer& aBuffer ) +{ + if( m_bitmapBase->ReadImageFile( aBuffer ) ) + { + m_bitmapBase->SetPixelSizeIu( (float) pcbIUScale.MilsToIU( 1000 ) + / m_bitmapBase->GetPPI() ); + return true; + } + + return false; +} + + EDA_ITEM* SCH_BITMAP::Clone() const { return new SCH_BITMAP( *this ); diff --git a/eeschema/sch_bitmap.h b/eeschema/sch_bitmap.h index d78ea68236..678f1165cb 100644 --- a/eeschema/sch_bitmap.h +++ b/eeschema/sch_bitmap.h @@ -108,6 +108,16 @@ public: */ bool ReadImageFile( const wxString& aFullFilename ); + /** + * Read and store an image file. + * + * Initialize the bitmap used to draw this item format. + * + * @param aBuf is the memory buffer containing the image file to read. + * @return true if success reading else false. + */ + bool ReadImageFile( wxMemoryBuffer& aBuf ); + void Move( const VECTOR2I& aMoveVector ) override { m_pos += aMoveVector;