SRL Archive - OSR Help

SMART Paint Memory Leak Help


YoHoJo

2012-03-09 06:08:38

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

Just the function:
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?!

Markus

2012-03-09 07:00:31

Canvas.free; maybe?

Sex

2012-03-09 13:12:48

From: Markus
Canvas.free; maybe?


Lmao…

YoHoJo

2012-03-10 05:11:04

Bump

Getdropped

2012-03-10 17:18:59

SMART_ClearCanvas;

^^ is that what your looking for?