spktoolbar: Remove restriction to 24-bit bitmaps. (see https://forum.lazarus.freepascal.org/index.php/topic,61200.0.html)

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8611 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2022-11-12 10:19:12 +00:00
parent 6cc0a5829a
commit 08fd914612
2 changed files with 0 additions and 50 deletions

View File

@ -425,9 +425,6 @@ var
Dist : double;
SrcImg, DestImg: TLazIntfImage;
begin
if (ABuffer.PixelFormat <> pf24Bit) or (ABitmap.PixelFormat <> pf24Bit) then
raise Exception.Create('TSpkGUITools.CopyRoundCorner: Only 24-bit bitmaps are accepted!');
// Validation
if Radius < 1 then
exit;
@ -567,9 +564,6 @@ class procedure TGUITools.CopyRoundRect(ABuffer, ABitmap: TBitmap; SrcPoint,
DstPoint: T2DIntVector; Width, Height, Radius: integer; ClipRect: T2DIntRect;
LeftTopRound, RightTopRound, LeftBottomRound, RightBottomRound: boolean);
begin
if (ABuffer.PixelFormat <> pf24Bit) or (ABitmap.PixelFormat <> pf24Bit) then
raise Exception.Create('TSpkGUITools.CopyBackground: Only 24 bit bitmaps are accepted!');
if Radius < 0 then
exit;
@ -746,9 +740,6 @@ class procedure TGUITools.CopyRoundRect(ABuffer : TBitmap; ABitmap: TBitmap; Src
DstPoint: T2DIntVector; Width, Height, Radius: integer; LeftTopRound,
RightTopRound, LeftBottomRound, RightBottomRound: boolean);
begin
if (ABuffer.PixelFormat <> pf24bit) or (ABitmap.PixelFormat <> pf24bit) then
raise exception.create('TSpkGUITools.CopyBackground: Only 24 bit bitmaps are accepted!');
if Radius < 0 then
exit;
@ -920,9 +911,6 @@ var
SrcImg: TLazIntfImage;
DestImg: TLazIntfImage;
begin
if (ABuffer.PixelFormat <> pf24Bit) or (ABitmap.PixelFormat <> pf24Bit) then
raise exception.create('TSpkGUITools.CopyRoundCorner: Only 24 bit bitmaps are accepted!');
// Validation
if (Width < 1) or (Height < 1) then
exit;
@ -1026,9 +1014,6 @@ var
DestImg: TLazIntfImage;
i: Integer;
begin
if (ABuffer.PixelFormat <> pf24Bit) or (ABitmap.PixelFormat <> pf24Bit) then
raise Exception.Create('TSpkGUITools.CopyRoundCorner: Only 24 bit bitmaps are accepted!');
if (AMask.PixelFormat <> pf8bit) then
raise Exception.Create('TSpkGUITools.CopyRoundCorner: Only 8-bit masks are accepted!');
@ -1133,8 +1118,6 @@ var
i: Integer;
MaskLine: Pointer;
begin
if (ABuffer.PixelFormat <> pf24Bit) or (ABitmap.PixelFormat <> pf24Bit) then
raise Exception.Create('TSpkGUITools.CopyMaskRectangle: Only 24 bit bitmaps are accepted!');
if AMask.PixelFormat<>pf8bit then
raise Exception.Create('TSpkGUITools.CopyMaskRectangle: Only 8-bit masks are accepted!');
@ -1244,9 +1227,6 @@ var BufferRect, BitmapRect : T2DIntRect;
DstLine: Pointer;
begin
if (ABuffer.PixelFormat<>pf24bit) or (ABitmap.PixelFormat<>pf24bit) then
raise exception.create('TSpkGUITools.CopyRoundCorner: Tylko 24-bitowe bitmapy s¹ akceptowane!');
// Sprawdzanie poprawnoœci
if (Width<1) or (Height<1) then
exit;
@ -1338,9 +1318,6 @@ var BufferRect, BitmapRect : T2DIntRect;
Dist : double;
begin
if (ABuffer.PixelFormat<>pf24bit) or (ABitmap.PixelFormat<>pf24bit) then
raise exception.create('TSpkGUITools.CopyRoundCorner: Tylko 24-bitowe bitmapy s¹ akceptowane!');
// Sprawdzanie poprawnoœci
if Radius<1 then
exit;
@ -1479,9 +1456,6 @@ var
BitmapRect: T2DIntRect;
cr, cg, cb: Byte;
begin
if ABitmap.PixelFormat <> pf24bit then
raise Exception.Create('TSpkGUITools.DrawAARoundCorner: Bitmapa musi byæ w trybie 24-bitowym!');
// Sprawdzamy poprawnoϾ
if Radius < 1 then
exit;
@ -1581,9 +1555,6 @@ var
BitmapRect: T2DIntRect;
cr,cb,cg: byte;
begin
if ABitmap.PixelFormat<>pf24bit then
raise Exception.Create('TSpkGUITools.DrawAARoundCorner: Bitmap must be in 24-bit mode!');
if Radius < 1 then
exit;
if (ABitmap.Width = 0) or (ABitmap.Height = 0) then
@ -1764,9 +1735,6 @@ end;
class procedure TGUITools.DrawAARoundFrame(ABitmap: TBitmap; Rect: T2DIntRect;
Radius: integer; Color: TColor; ClipRect: T2DIntRect);
begin
if ABitmap.PixelFormat <> pf24Bit then
raise Exception.Create('TGUITools.DrawAARoundFrame: Bitmap must be in 24-bit mode!');
if Radius < 1 then
exit;
@ -1799,9 +1767,6 @@ end;
class procedure TGUITools.DrawAARoundFrame(ABitmap: TBitmap; Rect: T2DIntRect;
Radius: integer; Color: TColor);
begin
if ABitmap.PixelFormat <> pf24Bit then
raise Exception.Create('TGUITools.DrawAARoundFrame: Bitmap must be in 24-bit mode!');
if Radius < 1 then
exit;
@ -2155,8 +2120,6 @@ var
LineRect: T2DIntRect;
BitmapRect: T2DIntRect;
begin
if ABitmap.PixelFormat <> pf24Bit then
raise Exception.Create('TGUITools.DrawHLine: Bitmap must be in 24-bit mode');
EnsureOrder(x1, x2);
{$IFDEF EnhancedRecordSupport}
@ -2182,8 +2145,6 @@ var
LineRect: T2DIntRect;
BitmapRect: T2DIntRect;
begin
if ABitmap.PixelFormat<>pf24bit then
raise Exception.Create('TGUITools.DrawHLine: Bitmap must be in 24-bit mode!');
EnsureOrder(x1, x2);
{$IFDEF EnhancedRecordSupport}
@ -2640,8 +2601,6 @@ class procedure TGUITools.RenderBackground(ABuffer: TBitmap;
var
TempRect: T2DIntRect;
begin
if ABuffer.PixelFormat<>pf24bit then
raise Exception.Create('TGUITools.RenderBackground: Bitmap must be in 24-bit mode');
if (Rect.Left > Rect.Right) or (Rect.Top > Rect.Bottom) then
exit;
@ -2716,9 +2675,6 @@ var
LineRect: T2DIntRect;
BitmapRect: T2DIntRect;
begin
if ABitmap.PixelFormat <> pf24bit then
raise Exception.Create('TGUITools.DrawHLine: Bitmap must be in 24-bit mode!');
EnsureOrder(y1, y2);
{$IFDEF EnhancedRecordSupport}
@ -2744,9 +2700,6 @@ var
LineRect: T2DIntRect;
BitmapRect: T2DIntRect;
begin
if ABitmap.PixelFormat <> pf24bit then
raise Exception.Create('TGUITools.DrawHLine: Bitmap must be in 24-bit mode!');
EnsureOrder(y1, y2);
{$IFDEF EnhancedRecordSupport}

View File

@ -700,10 +700,7 @@ begin
FToolbarDispatch := TSpkToolbarDispatch.Create(self);
FBuffer := TBitmap.Create;
FBuffer.PixelFormat := pf24bit;
FTemporary := TBitmap.Create;
FTemporary.Pixelformat := pf24bit;
SetLength(FTabRects, 0);