mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Windows: Fix conversion of WindowsBitmapImages to SoftwareBitmapImages
This commit is contained in:
parent
b7db89cb8e
commit
6f2293d91b
1 changed files with 12 additions and 2 deletions
|
|
@ -1019,8 +1019,18 @@ public:
|
|||
|
||||
std::unique_ptr<ImageType> createType() const override
|
||||
{
|
||||
// WindowsBitmapImage needs to be a software bitmap, not a D2D bitmap
|
||||
return std::make_unique<SoftwareImageType>();
|
||||
// This type only exists to return a type ID that's different to the SoftwareImageType's ID,
|
||||
// so that `SoftwareImageType{}.convert (windowsBitmapImage)` works.
|
||||
// If we return SoftwareImageType here, then SoftwareImageType{}.convert() will compare the
|
||||
// type IDs and assume the source image is already of the correct type.
|
||||
struct Type : public ImageType
|
||||
{
|
||||
int getTypeID() const override { return ByteOrder::makeInt ('w', 'b', 'i', 't'); }
|
||||
ImagePixelData::Ptr create (Image::PixelFormat, int, int, bool) const override { return {}; }
|
||||
Image convert (const Image&) const override { return {}; }
|
||||
};
|
||||
|
||||
return std::make_unique<Type>();
|
||||
}
|
||||
|
||||
std::unique_ptr<LowLevelGraphicsContext> createLowLevelContext() override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue