79083120

Date: 2024-10-13 12:29:48
Score: 3.5
Natty:
Report link

Okay, how do you feel about painting whites squares on a black background?

procedure TForm3.Button1Click(Sender: TObject);
var PD: TPathData;
    r,c:    Integer;
begin
  ImageControl1.Bitmap.SetSize(Round(ImageControl1.BoundsRect.Width), Round(ImageControl1.BoundsRect.Height));
  if ImageControl1.Bitmap.Canvas.BeginScene then
  try
    with ImageControl1.Bitmap.Canvas do
    begin
      Clear(TAlphaColorRec.Black);
      Fill.Kind := TBrushKind.Solid;
      Fill.Color := TAlphaColorRec.White;
      Stroke.Thickness := 2;

      PD := TPathData.Create;
      for r := 0 to 3 do begin
        for c := 0 to 3 do begin
          PD.MoveTo(PointF(c * 90 + 10, r * 90 + 10));
          PD.HLineToRel(80);
          PD.VLineToRel(80);
          PD.HLineToRel(-80);
          PD.ClosePath;
        end;
      end;

      DrawPath(PD,1);
      FillPath(PD,1);
      PD.Free;
    end;
  finally
    ImageControl1.Bitmap.Canvas.EndScene;
  end;
end;
Reasons:
  • Blacklisted phrase (1): how do you
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Looks like a comment (1):
  • Low reputation (0.5):
Posted by: Philip J. Rayment