Results 1 to 2 of 2

Thread: DebugPoints

  1. #1
    Join Date
    Jan 2012
    Posts
    1,104
    Mentioned
    18 Post(s)
    Quoted
    211 Post(s)

    Default DebugPoints

    I made a procedure (modified existing ones) for debugging a TPA and ATPA the SAME TIME. It marks the first in the ATPA.
    Pretty useful for testing!
    Simba Code:
    procedure DebugPoints(TPA: TPointArray; ATPA: array Of TPointArray);
    var
      BMP, x,y, i, Color : Integer;
      Box: TBox;
    begin
      BMP := BitmapFromClient(0,0,MSX2,MSY2);
      DrawTPABitmap(BMP,TPA,clRed);

      for i := 0 to high(ATPA) do
      begin
        if i = 0 then
          Color := clYellow
        else
          Color := clBlack;

        Box := getTPABounds(ATPA[i]);

        for x := Box.x1 to Box.x2 do
        begin
          FastSetPixel(BMP, x, Box.y1, Color)
          FastSetPixel(BMP, x, Box.y2, Color)
        end;
        for y := Box.y1 to Box.y2 do
        begin
          FastSetPixel(BMP, Box.x1, y, Color)
          FastSetPixel(BMP, Box.x2, y, Color)
        end;

      end;
      DebugBitmap(BMP);
      FreeBitmap(BMP);
    end;
    Last edited by Shatterhand; 04-16-2012 at 05:58 PM.

  2. #2
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Neat. I think I'll add this when I get home in a couple weeks. If no one does before me.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •