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