Ignore:
Timestamp:
May 22, 2020, 11:52:44 PM (4 years ago)
Author:
chronos
Message:
  • Fixed: Drawing start screen ornament under Windows.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/highdpi/Packages/CevoComponents/ScreenTools.pas

    r249 r251  
    981981var
    982982  P: TColor;
    983   X, Y, Light, Shade: Integer;
     983  X, Y: Integer;
     984  Light, Shade: TColor32;
    984985  PixelPtr: TPixelPointer;
    985986begin
    986987  if InitOrnamentDone then Exit;
    987   Light := MainTexture.clBevelLight;
     988  Light := ColorToColor32(MainTexture.clBevelLight);
    988989  // and $FCFCFC shr 2*3+MainTexture.clBevelShade and $FCFCFC shr 2;
    989   Shade := MainTexture.clBevelShade and $FCFCFC shr 2 * 3 +
    990     MainTexture.clBevelLight and $FCFCFC shr 2;
     990  Shade := ColorToColor32(MainTexture.clBevelShade and $FCFCFC shr 2 * 3 +
     991    MainTexture.clBevelLight and $FCFCFC shr 2);
    991992  GrExt[HGrSystem2].Data.BeginUpdate;
    992993  PixelPtr := PixelPointer(GrExt[HGrSystem2].Data, ScaleToNative(xOrna), ScaleToNative(yOrna));
    993   for Y := 0 to ScaleToNative(hOrna) - 1 do begin
    994     for X := 0 to ScaleToNative(wOrna) - 1 do begin
    995       P := Color32ToColor(PixelPtr.Pixel^.ARGB);
    996       if P = $0000FF then PixelPtr.Pixel^.ARGB := ColorToColor32(Light)
    997       else if P = $FF0000 then PixelPtr.Pixel^.ARGB := ColorToColor32(Shade);
    998       PixelPtr.NextPixel;
    999     end;
    1000     PixelPtr.NextLine;
     994  if PixelPtr.BytesPerPixel = 3 then begin
     995    for Y := 0 to ScaleToNative(hOrna) - 1 do begin
     996      for X := 0 to ScaleToNative(wOrna) - 1 do begin
     997        P := Color32ToColor(PixelPtr.Pixel^.GetRGB);
     998        if P = $0000FF then PixelPtr.Pixel^.SetRGB(Light)
     999        else if P = $FF0000 then PixelPtr.Pixel^.SetRGB(Shade);
     1000        PixelPtr.NextPixel;
     1001      end;
     1002      PixelPtr.NextLine;
     1003    end;
     1004  end else begin
     1005    for Y := 0 to ScaleToNative(hOrna) - 1 do begin
     1006      for X := 0 to ScaleToNative(wOrna) - 1 do begin
     1007        P := Color32ToColor(PixelPtr.Pixel^.ARGB);
     1008        if P = $0000FF then PixelPtr.Pixel^.ARGB := Light
     1009        else if P = $FF0000 then PixelPtr.Pixel^.ARGB := Shade;
     1010        PixelPtr.NextPixel;
     1011      end;
     1012      PixelPtr.NextLine;
     1013    end;
    10011014  end;
    10021015  InitOrnamentDone := True;
Note: See TracChangeset for help on using the changeset viewer.