SRL Archive - OSR Help

Im trying to make a live desk top viewer like Johura


Camaro'

2010-01-10 22:46:22

My Scar code is here…


program New;
{.include srl/srl.scar}
{.include srl/srl/misc/debug.scar}

var
i : integer;

Procedure DoIt;
begin
TakeScreenshotEx('C:\xampp\htdocs\1.bmp',0,0,1365,767);
BMPtoJPG('C:\xampp\htdocs\1.bmp', 'C:\xampp\htdocs\1.jpg');

i := InitializeHTTPClient(true, true);
AddPostVariable(i, 'file', 'C:\xampp\htdocs\1.jpg');
PostHTTPPageEx(i, 'http://aaronator.co.cc');
end;

begin
repeat

DoIt;
wait(4000);
until false;
end.

I need help on the php code :( ( cause i dont know php) anyone want to make it for me, id imagine it would take like 5min.

Harry

2010-01-10 22:49:29

You *need* to find a way to save it as a lossy jpg or a lossless png. A BMP will not work, it will destroy your bandwidth.

Camaro'

2010-01-10 22:51:26

From: Harry
You *need* to find a way to save it as a lossy jpg or a lossless png. A BMP will not work, it will destroy your bandwidth.


Oh. :( Is there a way scar can screeny something in the format of jpeg?

Even though , my bandwidth would be destroyed, could some one still make it for me , im kinda curious. I wouldnt be keeping it on for long.

Infantry001

2010-01-10 22:55:17

I don't believe he made it in SCAR, but in a different language.

Rick

2010-01-10 23:25:01

I just made a quick plugin for scar to convert a BMP to JPG if you want to use it.

http://www.megaupload.com/?d=ADI3525W

Usage:

BMPtoJPG('test.bmp', 'test.jpg');

Harry

2010-01-10 23:25:55

From: r!ch!e
I just made a quick plugin for scar to convert a BMP to JPG if you want to use it.

http://www.megaupload.com/?d=ADI3525W

Usage:

BMPtoJPG('test.bmp', 'test.jpg');

Cool. Please post source as well.

Rick

2010-01-10 23:31:26


library ImgLib;

uses
FastShareMem,
SysUtils,
Classes,
Windows,
Graphics,
Jpeg;

{$R *.res}

function BMPtoJPG(BMPName, JPGName: string): Boolean; Stdcall;
var
BMP: TBitmap;
JPG: TJpegImage;
begin
Result := False;
BMP := TBitmap.Create;
JPG := TJpegImage.Create;
try
BMP.LoadFromFile(BMPName);
JPG.Assign(BMP);
JPG.SaveToFile(JPGName);
Result := True;
finally
JPG.Free;
BMP.Free;
end;
end;

function GetFunctionCount(): Integer; stdcall; export;
begin
Result := 1;
end;

function GetFunctionInfo(x: Integer; var ProcAddr: Pointer; var ProcDef: PChar): Integer; stdcall;
begin
case x of
0:
begin
ProcAddr := @BMPtoJPG;
StrPCopy(ProcDef, 'function BMPtoJPG(BMPName, JPGName: string): Boolean;');
end;
else
x := -1;
end;
Result := x;
end;

exports GetFunctionCount;
exports GetFunctionInfo;

end.

Johura

2010-01-11 00:41:53

You don't need php code. Just SCAR + html. (Unless im confused about what your making).

Camaro'

2010-01-11 06:40:25

From: r!ch!e

library ImgLib;

uses
FastShareMem,
SysUtils,
Classes,
Windows,
Graphics,
Jpeg;

{$R *.res}

function BMPtoJPG(BMPName, JPGName: string): Boolean; Stdcall;
var
BMP: TBitmap;
JPG: TJpegImage;
begin
Result := False;
BMP := TBitmap.Create;
JPG := TJpegImage.Create;
try
BMP.LoadFromFile(BMPName);
JPG.Assign(BMP);
JPG.SaveToFile(JPGName);
Result := True;
finally
JPG.Free;
BMP.Free;
end;
end;

function GetFunctionCount(): Integer; stdcall; export;
begin
Result := 1;
end;

function GetFunctionInfo(x: Integer; var ProcAddr: Pointer; var ProcDef: PChar): Integer; stdcall;
begin
case x of
0:
begin
ProcAddr := @BMPtoJPG;
StrPCopy(ProcDef, 'function BMPtoJPG(BMPName, JPGName: string): Boolean;');
end;
else
x := -1;
end;
Result := x;
end;

exports GetFunctionCount;
exports GetFunctionInfo;

end.


Thats pretty :) Thanks rep+

Any one have the PHP to upload a jpg from scar to a server ? ( I dont know much php ( i dont think hml can do that with the scar ) )

I posted my scar code on the first page, except the new one has the BMPToJPG Function r!ch!e made

Frement

2010-01-11 06:55:29

Maybe open the image as txt and use a basic post for transfer, then a php script which would create a file "asd.jpg" and paste the contents. Shouldnt that work?

Awkwardsaw

2010-01-11 08:11:51

does my php not work? :(

Camaro'

2010-01-11 14:48:26

From: Awkwardsaw
does my php not work? :(


Uh no :) What i need is pretty basic php, I would learn how but i have not much time cause EXAMS are on its way :(

Frement

2010-01-11 14:55:16

[QUOTE=Camaro';674147]Uh no :) What i need is pretty basic php, I would learn how but i have not much time cause EXAMS are on its way :([/QUOTE]

What you need to know? If you need instant help alot you can add me on MSN, pm me your msn or something.

Camaro'

2010-01-11 14:58:36

[email]air_mc_Roberts@hotmail.com[/email]
My bad, i wasnt paying enough attention to realize i should of pmed it. Whatever

MylesMadness

2010-01-11 15:12:10

You don't need php unless your not hosting the images on your home network

Camaro'

2010-01-11 15:31:58

From: MylesMadness
You don't need php unless your not hosting the images on your home network


The images are gonna be on the server. Unless there is another way to do it?(While having my live viewer on a internet site( not my home server) )

Simtoon

2010-01-11 16:15:40

Tootoot222 said and ss23 said you need to encrypt them to base64 then decrypt them after you sent the image in base64

Camaro'

2010-01-11 16:21:42

Like dtms ?




I would have no cliue how to do that :(