mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-23 19:39:47 +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:
|
||||||
@ -1527,6 +1530,9 @@ begin
|
|||||||
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);
|
||||||
CGContextScaleCTM(CGContext, 1, -1);
|
CGContextScaleCTM(CGContext, 1, -1);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user