Results 1 to 5 of 5

Thread: SMART Paint Memory Leak Help

  1. #1
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default SMART Paint Memory Leak Help

    http://villavu.com/forum/showthread.php?t=53148
    Entire Script ^ (In v2)

    Just the function:
    Simba Code:
    procedure SMART_DrawBitmapWithTextMulti(Clear: Boolean; Bitmap: Integer; BmpPlacement: TPoint; TP: TStringArray; Shadow: Boolean; TxtPlacement: TPoint; Font: string; Colour: TColor);
    var
      I, B, H, Pic, TPH, Numb: Integer;
      Offset: TPoint;
      TTP: TPointArray;
      Canvas: TCanvas;
    begin

      if (not SMART_DebugSetup) then
        SMART_SetupDebug();

      {if (Clear) then
        SMART_ClearCanvasArea( PointToBox( Point(MSX1, MSY1) , Point(MSX2, MSY2) ) );
      SMART_ClearCanvas();}


      TPH := High(TP);

      Offset := IntToPoint(TxtPlacement.x - BmpPlacement.x, TxtPlacement.y - BmpPlacement.y);

      Pic := CopyBitmap(Bitmap);

      for I := 0 to TPH do
      begin

        TTP := LoadTextTPA(TP[i], SmallChars, H);

        for B := 0 to High(TTP) do
        begin

          Numb := ((I + 1) * 13);

          if Shadow then
            try

              FastSetPixel(Pic, TTP[b].x + 1 + Offset.x , TTP[b].y + Numb + 1 + Offset.y,131072);
            except
            end;

          try

            FastSetPixel(Pic, TTP[b].x + Offset.x, TTP[b].y + Numb + Offset.y, Colour);
          except
          end;
        end;
      end;

      Canvas := TCANVAS.Create;
      Canvas.Handle := SmartGetDebugDC;
      DrawBitmap(Pic, Canvas, BmpPlacement.x, BmpPlacement.y);
      FreeBitmap(Pic);
    end;

    How I Fix?!

  2. #2
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    Canvas.free; maybe?
    I made a new script, check it out!.

  3. #3
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Markus View Post
    Canvas.free; maybe?
    Lmao...
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  4. #4
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

  5. #5
    Join Date
    Nov 2011
    Location
    United states
    Posts
    516
    Mentioned
    1 Post(s)
    Quoted
    1 Post(s)

    Default

    SMART_ClearCanvas;

    ^^ is that what your looking for?

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
  •