diff --git a/uppsrc/Draw/Image.h b/uppsrc/Draw/Image.h index 141e60c09..85884d084 100644 --- a/uppsrc/Draw/Image.h +++ b/uppsrc/Draw/Image.h @@ -186,6 +186,7 @@ public: int GetKindNoScan() const; int GetKind() const; int GetResolution() const; + bool IsOpaque() const { return GetKind() == IMAGE_OPAQUE; } const RGBA *Begin() const { return data ? ~data->buffer : NULL; } const RGBA *begin() const { return Begin(); } diff --git a/uppsrc/Draw/ImageOp.cpp b/uppsrc/Draw/ImageOp.cpp index 34017c06a..1db8446b5 100644 --- a/uppsrc/Draw/ImageOp.cpp +++ b/uppsrc/Draw/ImageOp.cpp @@ -61,6 +61,13 @@ Image CreateImage(Size sz, Color color) return CreateImage(sz, (RGBA)color); } +void ScanOpaque(Image& m) +{ + ImageBuffer ib(m); + ib.SetKind(ib.ScanKind()); + m = ib; +} + force_inline Size DstSrc(ImageBuffer& dest, Point& p, const Image& src, Rect& sr) { if(p.x < 0) { diff --git a/uppsrc/Draw/ImageOp.h b/uppsrc/Draw/ImageOp.h index ab2d8965d..631e3d1cb 100644 --- a/uppsrc/Draw/ImageOp.h +++ b/uppsrc/Draw/ImageOp.h @@ -11,6 +11,8 @@ void SetResolution(Image& m, int res); Image WithResolution(const Image& m, int res); Image WithResolution(const Image& m, const Image& res); +void ScanOpaque(Image& m); + void Over(ImageBuffer& dest, Point p, const Image& src, const Rect& srect); void Over(Image& dest, const Image& src); void Copy(ImageBuffer& dest, Point p, const Image& src, const Rect& srect); diff --git a/uppsrc/Draw/Iml.cpp b/uppsrc/Draw/Iml.cpp index 9827d497d..f6342571c 100644 --- a/uppsrc/Draw/Iml.cpp +++ b/uppsrc/Draw/Iml.cpp @@ -134,6 +134,7 @@ Image Iml::Get(int i) } if(!IsNull(m.image) && (mode & GUI_MODE_UHD)) // this is to support legacy code mostly SetResolution(m.image, IMAGE_RESOLUTION_UHD); + ScanOpaque(m.image); } m.loaded = true; }