Browse Source

Add SCH_BITMAP::ReadImageFile( wxMemoryBuffer& ).

newinvert
Alex Shvartzkop 2 years ago
parent
commit
69261df022
  1. 13
      eeschema/sch_bitmap.cpp
  2. 10
      eeschema/sch_bitmap.h

13
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 );

10
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;

Loading…
Cancel
Save