laakerules
2012-01-15 16:05:19
Excactly as title, all i want to know is if its possible to add a picture from a direct link to a simba GUI?
2012-01-15 16:05:19
2012-01-15 16:10:36
2012-01-15 16:11:31
2012-01-15 16:11:49
From: Dynamite
Do you mean a form?
-Boom
2012-01-15 16:20:24
2012-01-15 16:27:37
2012-01-15 16:31:47
2012-01-15 16:33:44
program ImageProc;
//{$loadlib SSecurity} //Plugin to convert Any images to Bitmaps.. Not needed since simba can do PNG's
{$i SRL/SRL.simba}
{$I srl/srl/misc/debug.simba}
Function ImageProc(BMPName: String; Placement: TPoint; TP: TStringArray): String; //Don't touch this function..
var
Image, Path: string;
FP, Item, X, Y, SX, SY, I, B, H: Integer;
ATPA: T2DPointArray;
Canvas: TCanvas;
Colors: TIntegerArray;
begin
Image:= GetPage('http://i1220.photobucket.com/albums/dd448/laakerules/on_cap10.png');
Path:= ScriptPath + BMPName + '.png';
Path:= Trim(Path);
FP:= CreateFile(Path);
WriteFileString(FP, Image);
CloseFile(FP);
//ImgToBMP(ScriptPath + BMPName + '.bmp'); //Function in plugin..
Item:= LoadBitmap(ScriptPath + BMPName + '.png');
GetBitmapSize(Item, Sx, SY);
//Paint on smart Bitmap.
SmartSetDebug(True); //Turns Debug on..
GetClientDimensions(x, y);
SetArrayLength(ATPA, Length(TP));
for I := 0 to High(ATPA) do
begin
ATPA[i] := LoadTextTPA(TP[i], UpChars, H);
for B := 0 to High(ATPA[i]) do
ATPA[i][B].y := ATPA[i][B].y + i*(H);
end;
if Length(Colours) = 4 then
begin
SetArrayLength(Colors, Length(TP));
for i := 0 to High(Colors) do
Colors[i] := Colours[1];
end else
Colors := Colours;
DrawATPABitmapEx(Item, ATPA, Colors);
Canvas := TCANVAS.Create;
Canvas.Handle := SmartGetDebugDC;
DrawBitmap(Item, Canvas, Placement.x, Placement.y);
FreeBitmap(Item);
end;
Begin
SetupSRL;
ImageProc('law', Point(0, 0), ['']);
end.
2012-01-15 16:34:19
2012-01-15 16:50:22