LazMapViewer: Improved text rendering by IntfGraphicsDrawingEngine when text color is white
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9310 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
fb42932f2e
commit
9fcf346d74
@ -38,9 +38,9 @@ object MainForm: TMainForm
|
||||
Height = 662
|
||||
Top = 0
|
||||
Width = 275
|
||||
ActivePage = PgData
|
||||
ActivePage = PgConfig
|
||||
Align = alRight
|
||||
TabIndex = 0
|
||||
TabIndex = 2
|
||||
TabOrder = 1
|
||||
object PgData: TTabSheet
|
||||
Caption = 'Data'
|
||||
@ -926,7 +926,7 @@ object MainForm: TMainForm
|
||||
object BtnPOITextFont: TButton
|
||||
AnchorSideTop.Control = CbShowPOIImage
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Left = 8
|
||||
Height = 25
|
||||
Top = 508
|
||||
Width = 93
|
||||
@ -943,10 +943,10 @@ object MainForm: TMainForm
|
||||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = CbDrawingEngine
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 154
|
||||
Left = 156
|
||||
Height = 22
|
||||
Top = 509
|
||||
Width = 107
|
||||
Width = 105
|
||||
NoneColorColor = clWhite
|
||||
Style = [cbStandardColors, cbExtendedColors, cbIncludeNone, cbCustomColor, cbPrettyNames, cbCustomColors]
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
@ -960,7 +960,7 @@ object MainForm: TMainForm
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = BtnPOITextFont
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 107
|
||||
Left = 109
|
||||
Height = 15
|
||||
Top = 513
|
||||
Width = 39
|
||||
|
@ -342,7 +342,10 @@ procedure TMainForm.BtnPOITextFontClick(Sender: TObject);
|
||||
begin
|
||||
FontDialog.Font.Assign(MapView.Font);
|
||||
if FontDialog.Execute then
|
||||
begin
|
||||
MapView.Font.Assign(FontDialog.Font);
|
||||
MapView.Invalidate;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMainForm.CbDebugTilesChange(Sender: TObject);
|
||||
|
@ -239,7 +239,7 @@ begin
|
||||
rawImg.Description.Init_BPP32_A8R8G8B8_BIO_TTB(AWidth, AHeight);
|
||||
{$ELSE}
|
||||
rawImg.Description.Init_BPP32_B8G8R8_BIO_TTB(AWidth, AHeight);
|
||||
// rawImg.Description.Init_BPP32_B8G8R8A8_BIO_TTB(AWidth, AHeight);
|
||||
// No alpha-channel for buffer image since it will be drawn on the MapView canvas.
|
||||
{$ENDIF}
|
||||
rawImg.CreateData(True);
|
||||
ABuffer := TLazIntfImage.Create(rawImg, true);
|
||||
@ -261,7 +261,6 @@ var
|
||||
intfImg: TLazIntfImage;
|
||||
i, j, iX, jY: Integer;
|
||||
cimg, cbuf: TFPColor;
|
||||
alpha: Double;
|
||||
begin
|
||||
intfImg := ABitmap.CreateIntfImage;
|
||||
try
|
||||
@ -338,7 +337,10 @@ begin
|
||||
begin
|
||||
gray := CalculateGray(col);
|
||||
col := opCol;
|
||||
col.Alpha := $FFFF - gray;
|
||||
if SameColor(opCol, colWhite) then
|
||||
col.Alpha := gray
|
||||
else
|
||||
col.Alpha := $FFFF - gray;
|
||||
end;
|
||||
FBuffer.Colors[iX, jY] := AlphaBlend(FBuffer.Colors[iX, jY], col);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user