mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-23 13:59:24 +01:00
Add info if bitmap format is not supported for creating canvas handle.
git-svn-id: trunk@15779 -
This commit is contained in:
parent
91146521fe
commit
c85ebeb48d
@ -1494,11 +1494,14 @@ procedure TCarbonBitmapContext.Reset;
|
|||||||
var
|
var
|
||||||
Info: CGBitmapInfo;
|
Info: CGBitmapInfo;
|
||||||
begin
|
begin
|
||||||
if CGContext <> nil then CGContextRelease(CGContext);
|
if CGContext <> nil then
|
||||||
|
begin
|
||||||
|
CGContextRelease(CGContext);
|
||||||
|
CGContext := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
if FBitmap = nil then
|
|
||||||
CGContext := nil
|
if FBitmap <> nil then
|
||||||
else
|
|
||||||
begin
|
begin
|
||||||
{$note TODO: convert data if image format is incomatible with context}
|
{$note TODO: convert data if image format is incomatible with context}
|
||||||
// MWE:
|
// MWE:
|
||||||
@ -1526,6 +1529,9 @@ begin
|
|||||||
CGContext := CGBitmapContextCreate(FBitmap.Data, FBitmap.Width, FBitmap.Height,
|
CGContext := CGBitmapContextCreate(FBitmap.Data, FBitmap.Width, FBitmap.Height,
|
||||||
FBitmap.BitsPerComponent, FBitmap.BytesPerRow, FBitmap.ColorSpace,
|
FBitmap.BitsPerComponent, FBitmap.BytesPerRow, FBitmap.ColorSpace,
|
||||||
Info);
|
Info);
|
||||||
|
|
||||||
|
if CGContext = nil then
|
||||||
|
DebugLn('Unable to create Canvas Handle for Bitmap. Format "', DbgS(Info), '" is not supported!');
|
||||||
|
|
||||||
// flip and offset CTM to upper left corner
|
// flip and offset CTM to upper left corner
|
||||||
CGContextTranslateCTM(CGContext, 0, FBitmap.Height);
|
CGContextTranslateCTM(CGContext, 0, FBitmap.Height);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user