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
This commit is contained in:
wp_xxyyzz
2016-12-20 22:28:49 +00:00
parent 69886645c6
commit db5064590a
4 changed files with 11 additions and 11 deletions

View File

@ -111,7 +111,7 @@ begin
// ControlStyle := ControlStyle - [csAcceptsControls] + [csOpaque]; // ControlStyle := ControlStyle - [csAcceptsControls] + [csOpaque];
PBack := TBitmap.Create; PBack := TBitmap.Create;
PBack.PixelFormat := pf32bit; // PBack.PixelFormat := pf32bit;
SetInitialBounds(0, 0, 206, 146); SetInitialBounds(0, 0, 206, 146);
TabStop := true; TabStop := true;
FSelectedColor := clRed; FSelectedColor := clRed;

View File

@ -110,7 +110,7 @@ begin
FGValue := 0; FGValue := 0;
FBValue := 0; FBValue := 0;
PBack := TBitmap.Create; PBack := TBitmap.Create;
PBack.PixelFormat := pf32bit; // PBack.PixelFormat := pf32bit;
SetInitialBounds(0, 0, 245, 245); SetInitialBounds(0, 0, 245, 245);
TabStop := true; TabStop := true;
FSelectedColor := clRed; FSelectedColor := clRed;

View File

@ -108,7 +108,7 @@ begin
FMaxS := 240; FMaxS := 240;
FMaxL := 100; FMaxL := 100;
PBack := TBitmap.Create; PBack := TBitmap.Create;
PBack.PixelFormat := pf32bit; // PBack.PixelFormat := pf32bit;
ParentColor := true; ParentColor := true;
SetInitialBounds(0, 0, WSL + DIST + WH, HSL + 2*VDELTA); SetInitialBounds(0, 0, WSL + DIST + WH, HSL + 2*VDELTA);
TabStop := true; TabStop := true;

View File

@ -139,15 +139,15 @@ end;
procedure TmbCustomPicker.CreateGradient; procedure TmbCustomPicker.CreateGradient;
var var
x, y: Integer; x, y: Integer;
row: pRGBQuadArray; col: TColor;
c: TColor; fpcol: TFPColor;
intfimg: TLazIntfImage; intfimg: TLazIntfImage;
imgHandle, imgMaskHandle: HBitmap; imgHandle, imgMaskHandle: HBitmap;
begin begin
if FBufferBmp = nil then if FBufferBmp = nil then
begin begin
FBufferBmp := TBitmap.Create; FBufferBmp := TBitmap.Create;
FBufferBmp.PixelFormat := pf32bit; // FBufferBmp.PixelFormat := pf32bit;
end; end;
FBufferBmp.Width := FGradientWidth; FBufferBmp.Width := FGradientWidth;
FBufferBmp.Height := FGradientHeight; FBufferBmp.Height := FGradientHeight;
@ -158,13 +158,13 @@ begin
for y := 0 to FBufferBmp.Height - 1 do for y := 0 to FBufferBmp.Height - 1 do
begin begin
row := intfImg.GetDataLineStart(y); //FBufferBmp.Height - 1 - y);
for x := 0 to FBufferBmp.Width - 1 do for x := 0 to FBufferBmp.Width - 1 do
begin begin
c := GetGradientColor2D(x, y); col := GetGradientColor2D(x, y);
if WebSafe then if WebSafe then
c := GetWebSafe(c); col := GetWebSafe(col);
row[x] := RGBToRGBQuad(GetRValue(c), GetGValue(c), GetBValue(c)); fpcol := TColorToFPColor(col);
intfImg.Colors[x, y] := fpcol;
end; end;
end; end;
@ -172,7 +172,7 @@ begin
FBufferBmp.Handle := imgHandle; FBufferBmp.Handle := imgHandle;
FBufferBmp.MaskHandle := imgMaskHandle; FBufferBmp.MaskHandle := imgMaskHandle;
finally finally
intfimg.Free; intfimg.Free;
end; end;
end; end;