From db5064590a96ceb94be3542913f4a199da1a20e3 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Tue, 20 Dec 2016 22:28:49 +0000 Subject: [PATCH] mbColorLib: Fix painting issues of TmbColorPicker descendents in Linux. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5551 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/mbColorLib/HSLColorPicker.pas | 2 +- components/mbColorLib/HSLRingPicker.pas | 2 +- components/mbColorLib/SLHColorPicker.pas | 2 +- components/mbColorLib/mbColorPickerControl.pas | 16 ++++++++-------- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/components/mbColorLib/HSLColorPicker.pas b/components/mbColorLib/HSLColorPicker.pas index 1a57c1aa6..9458f97a3 100644 --- a/components/mbColorLib/HSLColorPicker.pas +++ b/components/mbColorLib/HSLColorPicker.pas @@ -111,7 +111,7 @@ begin // ControlStyle := ControlStyle - [csAcceptsControls] + [csOpaque]; PBack := TBitmap.Create; - PBack.PixelFormat := pf32bit; +// PBack.PixelFormat := pf32bit; SetInitialBounds(0, 0, 206, 146); TabStop := true; FSelectedColor := clRed; diff --git a/components/mbColorLib/HSLRingPicker.pas b/components/mbColorLib/HSLRingPicker.pas index 5a21c6ae4..9320c1c40 100644 --- a/components/mbColorLib/HSLRingPicker.pas +++ b/components/mbColorLib/HSLRingPicker.pas @@ -110,7 +110,7 @@ begin FGValue := 0; FBValue := 0; PBack := TBitmap.Create; - PBack.PixelFormat := pf32bit; +// PBack.PixelFormat := pf32bit; SetInitialBounds(0, 0, 245, 245); TabStop := true; FSelectedColor := clRed; diff --git a/components/mbColorLib/SLHColorPicker.pas b/components/mbColorLib/SLHColorPicker.pas index 66ca7525a..4492bc0af 100644 --- a/components/mbColorLib/SLHColorPicker.pas +++ b/components/mbColorLib/SLHColorPicker.pas @@ -108,7 +108,7 @@ begin FMaxS := 240; FMaxL := 100; PBack := TBitmap.Create; - PBack.PixelFormat := pf32bit; +// PBack.PixelFormat := pf32bit; ParentColor := true; SetInitialBounds(0, 0, WSL + DIST + WH, HSL + 2*VDELTA); TabStop := true; diff --git a/components/mbColorLib/mbColorPickerControl.pas b/components/mbColorLib/mbColorPickerControl.pas index ed9608890..66b7363ab 100644 --- a/components/mbColorLib/mbColorPickerControl.pas +++ b/components/mbColorLib/mbColorPickerControl.pas @@ -139,15 +139,15 @@ end; procedure TmbCustomPicker.CreateGradient; var x, y: Integer; - row: pRGBQuadArray; - c: TColor; + col: TColor; + fpcol: TFPColor; intfimg: TLazIntfImage; imgHandle, imgMaskHandle: HBitmap; begin if FBufferBmp = nil then begin FBufferBmp := TBitmap.Create; - FBufferBmp.PixelFormat := pf32bit; +// FBufferBmp.PixelFormat := pf32bit; end; FBufferBmp.Width := FGradientWidth; FBufferBmp.Height := FGradientHeight; @@ -158,13 +158,13 @@ begin for y := 0 to FBufferBmp.Height - 1 do begin - row := intfImg.GetDataLineStart(y); //FBufferBmp.Height - 1 - y); for x := 0 to FBufferBmp.Width - 1 do begin - c := GetGradientColor2D(x, y); + col := GetGradientColor2D(x, y); if WebSafe then - c := GetWebSafe(c); - row[x] := RGBToRGBQuad(GetRValue(c), GetGValue(c), GetBValue(c)); + col := GetWebSafe(col); + fpcol := TColorToFPColor(col); + intfImg.Colors[x, y] := fpcol; end; end; @@ -172,7 +172,7 @@ begin FBufferBmp.Handle := imgHandle; FBufferBmp.MaskHandle := imgMaskHandle; finally - intfimg.Free; + intfimg.Free; end; end;