View Full Version : Painting on SMART
Total
12-10-2012, 12:41 AM
So I have a script that has a on screen progress report and I was wondering if there is a way that I could pull the picture off imgur or something instead of converting it to bmp and just putting it in the script as it makes my script over 200mb. I now have to zip my scripts, which isn't a big deal but I was wondering if anyone knew a way of doing something like this. I think there's a way to pull the picture directly from your PC but that would just make it more difficult for the users for no reason.
Any ideas?
DannyRS
12-10-2012, 12:51 AM
I know you can grab the image off imgur and save it to a location to use, as for a guide i have no idea, my Air runner or any of ashamans stuff with a SPS map have his way of grabbing an image feature (All credit to Asham and who ever wrote that originally!),
As for actually using the paint though, cant help you there as i have no idea, maybe look for a tut / read over flights scripts to learn how, they have great paints
Edit - if you can grab the image from imgur to a file location like how mentioned before, surely you can use that in a paint?
Total
12-10-2012, 02:01 AM
Yeah that may work. I'll have to look into that image grabber. Thanks.
Justin
12-10-2012, 02:10 AM
Yeah that may work. I'll have to look into that image grabber. Thanks.
Look into Ashamans LRC miner, I think Dgby made a snippit on how its done (included in the script)
Just make sure you give credit where its due.
Yeah ive done it before, use dgby's downloadtofile function then just use loadbitmap :)
Total
12-10-2012, 10:10 AM
Alright so I was able to get the file from imgur, but when I try and load the bitmap it says invalid filetype desipte it being a .bmp.
Procedure DownloadImage(ImageName: String; Location: String);
var
Image, Path: string; //Method
FP: Integer;
begin
Image:= GetPage(Location);
Path:= 'C:\Simba\Scripts\' + ImageName + '.bmp';
Path:= Trim(Path);
FP:= CreateFile(Path);
WriteFileString(FP, Image);
CloseFile(FP); //Method
end;
Function GrabMaps: Boolean;
var
ProggyLoc: String; //Map Locations
ProggyName: String; //Map Names
begin
ProggyName:= 'TotalGnomesProggy'; //Method
ProggyLoc:= 'http://imgur.com/KG6WC';
if (Not FileExists('C:\Simba\Scripts\TotalGnomesProggy.bmp ')) then
DownloadImage(ProggyName, ProggyLoc);
Result:= (FileExists('C:\Simba\Scripts\TotalGnomesProggy.bm p'));
end;
When I run LoadBitmap on the file location it gives me
Exception: Error while reading stream: Wrong image format at line 57
So confused right now lol.
Le Jingle
12-10-2012, 10:19 AM
If you are trying to download an image and use it as a progress report for your script, you could go with what flight uses in his Barb fly-fisher (http://villavu.com/forum/showthread.php?t=67765); it loads a .png from url, saves it to file, then draws it from the .png file to screen. I don't mean to give you a run-around on methods of painting on smart, yet I believe this method may better suit you needs without having to do more editing, no? On that note, I'd imagine you'll lean some understanding of how to properly implement the feature into your own script, also to note his usages.
cheers,
Lj
:)
Total
12-10-2012, 11:26 AM
Ah yes, thanks for showing me that. I'll be sure to credit Flight. Confusing how LoadBitmap accepts png's but whatever haha.
Edit: Looks like it's Dgby's procedure actually.
Le Jingle
12-10-2012, 11:41 AM
Ah yes, thanks for showing me that. I'll be sure to credit Flight. Confusing how LoadBitmap accepts png's but whatever haha.
No problem, also LoadBitmap loads data from filepath, so it's not necessarily required to use .bmp's for LoadBitmap, however it is required to use PNM images.
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.