Results 1 to 9 of 9

Thread: Loading bitmaps from the web!

  1. #1
    Join Date
    Aug 2007
    Posts
    104
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Loading bitmaps from the web!

    Sick of those LONG bitmap strings? Looking for something fresh? Then this is the thread for you!

    This is my first tutorial so please tell me if I do anything wrong.

    First off we need to get the bitmap string. Run a bitmap to string command. If the bitmap is very big then use the Mass Bitmap to String program included with scar.

    Next take your code and remove all of the 's and +s and then one line it.

    Bad code :

    SCAR Code:
    'aosdoinancnewlwmda'+
    'ladmckslwmd'

    Good code :

    SCAR Code:
    aosdoinancnewlwmdaladmckslwmd

    Why do we do this?

    Well, when you get the text from the web page it will return the text as a string. And, when a function returns a string it automatically adds the 's to the string. So when we get the text off the page it would look like:

    SCAR Code:
    ''gdsfegdfsfcsadf'+
    '
    dsasdcsdfewfw'';

    So you will see that the 's and +s are actually included in the string. That would be bad.

    Next we need to setup a web hosting account. I reccomend phpnet.us or freehostia.

    Once you are registerd you should go to the control panel for your page and go to your file manager. Open notepad and copy your code in. Remember, if any of your code is pink in scar then this won't work. Save your file and upload it to your page.

    Now, for scar to connect to your page.

    We will use a function called GetPage;. This returns all the text on a page.

    SCAR Code:
    GetPage();

    Now, the page must (or should) start with http://. Copy your web page that the text is being hosted on into the GetPage parameter. Make sure it is a string.

    Example:
    SCAR Code:
    GetPage('http://mywebpage.phpnet.us/mypicture.txt');

    Now we need to have a variable to hold the data that we get. I will use the variable MyPicture.

    SCAR Code:
    MyPicture := GetPage('http://mywebpage.phpnet.us/mypicture.txt');

    Now we should test. Use a simple writeln(); to see if it returns a correct string.

    Tester :
    SCAR Code:
    program TestBitmapTutorial;
    var
      MyPicture : String;
    begin
      MyPicture := GetPage('http://mywebpage.phpnet.us/mypicture.txt');
      writeln(MyPicture);
    end.

    If it wrote out your bitmap correctly then you are able to move on to the next step. If not then please review and see what you did wrong.

    Now, adding it to a form. I won't go into much detail for this because it is really simple.

    Just add :

    SCAR Code:
    Image1 := TImage.Create(frmDesign);
    Image1.Parent := frmDesign;
    Image1.Left := 17;
    Image1.Top := 4;
    Image1.Width := 34;
    Image1.Height := 30;
    //Go To Have This After The Image!!!
    //Loads Bitmap To String
    target := MyPicture;
    //Dont No What This Does :P , Canvas Gets The Picture?
    C:= GetBitmapCanvas(target);
    //34 and 30 are the size of the pic.
    //Paints The Picture. Just Keep The Zeros The Same, And Change
    //The 34 and 30 to the size of bitmaps (BitmapFromString(34<<, 30<<,stuff here)
    CopyCanvas(C, Image1.Canvas, 0, 0, 34, 30, 0, 0, 34, 30);

    To your InitForm procedure.

    NOTE: There are comments for learning.

    Pretty simple eh?

    Please post.

    The Element

    EDIT: Pictures coming!

  2. #2
    Join Date
    Feb 2007
    Location
    SparklesProd.com
    Posts
    2,406
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Do you mean GetPage, not GetUrl?


  3. #3
    Join Date
    Aug 2007
    Posts
    104
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Darn -.-.

    Edited ...you always catch my mistakes

  4. #4
    Join Date
    Feb 2006
    Posts
    433
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I give up.

  5. #5
    Join Date
    Aug 2007
    Posts
    104
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Spky View Post
    I give up.
    Sorry? Did you have any problems?

  6. #6
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default

    Quote Originally Posted by Spky View Post
    I give up.
    What, you mean that this nub is better than you?

    Scripts: Edgeville Chop & Bank, GE Merchanting Aid
    Tutorials: How to Dominate the Grand Exchange

    Quote Originally Posted by YoHoJo View Post
    I like hentai.

  7. #7
    Join Date
    Aug 2007
    Posts
    104
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Please don't call me a "nub" or a "noob" or a "leecher". I am trying to learn. Any of those terms refer to people who either offended someone else or does not give back or the community. I am trying to give back.

  8. #8
    Join Date
    Feb 2006
    Posts
    433
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Read http://www.villavu.com/forum/showthr...=15063?t=16595

    And yeh, your not a nub You just forgot some stuff.

  9. #9
    Join Date
    Aug 2007
    Posts
    104
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I'm sorry,

    I looked at the thread and it didn't look like I missed anything othere then BitmapToString2. I will add it in. Please inform me of what I missed.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. RS loading screen?
    By CallOfVideos in forum OSR Help
    Replies: 2
    Last Post: 09-03-2008, 07:21 PM
  2. Replies: 2
    Last Post: 09-18-2007, 12:49 AM
  3. runescape not loading..
    By JAD in forum News and General
    Replies: 3
    Last Post: 03-18-2007, 07:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •