Results 1 to 10 of 10

Thread: Anyone Know how to Add pic to gui from website?

  1. #1
    Join Date
    Dec 2011
    Posts
    1,162
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Anyone Know how to Add pic to gui from website?

    Excactly as title, all i want to know is if its possible to add a picture from a direct link to a simba GUI?

  2. #2
    Join Date
    Dec 2011
    Location
    P2P :)
    Posts
    561
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    You can add pictures but you will have to convert a .BMP to a string using the option 'Bitmap conversion' under Tools on the main Simba bar. As for use from a link I doubt that is possible.
    I wear my scars like the rings on a pimp
    I live life like the captain of a sinking ship
    Always sell your product for ATLEAST mid to ensure that the market doesn't drop.

  3. #3
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Do you mean a form?

    -Boom

  4. #4
    Join Date
    Dec 2011
    Posts
    1,162
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    HMmmm, i could make it download and place it into a certain spot then load it from there though? Rite?


    Quote Originally Posted by Dynamite View Post
    Do you mean a form?

    -Boom

    No i can easily do the form, for it in a location on the computer. I was just wondering if you could like have it take the pic off a direct link such as

    http://i1220.photobucket.com/albums/...s/on_cap10.png

    to look like this on the GUI

    Last edited by laakerules; 01-15-2012 at 09:15 PM.

  5. #5
    Join Date
    Dec 2011
    Location
    P2P :)
    Posts
    561
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Well you can try to look at the Tut by flight about drawing on SMART. You can add text AND images. Be warned though the bigger the image the bigger and messier the string will look.

    http://villavu.com/forum/showthread....paint+on+smart



    Edit: Yeah the BMP for that image is nasty huge. 1.1k lines+
    I wear my scars like the rings on a pimp
    I live life like the captain of a sinking ship
    Always sell your product for ATLEAST mid to ensure that the market doesn't drop.

  6. #6
    Join Date
    Dec 2011
    Posts
    1,162
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Holy crap 1.1k lines!!!!!!!!!!!!!!!! :0

  7. #7
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    You don't actually have to do the whole string conversation, you can just download the file from a URL, store it into a folder, and just access that file from within the folder. Looks far neater.

  8. #8
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Include smart and this will do it.. Thing is ur better of splitting this function into two parts.. One part that will download the file if it doesn't exist.. then the other part that will paint it onto smart.. I'll leave that to u as I did most of it already.
    Simba Code:
    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.
    I am Ggzz..
    Hackintosher

  9. #9
    Join Date
    Dec 2011
    Posts
    1,162
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ya richard, i can do that. But could i add a implementation into the Form that when it opens it downloads the immage places it somewhere then uses that image? make it so that my script users dont have to download it themselves and place it in a certain folder somewhere themselves.

  10. #10
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    The code ggzz posted shows how to do it. To save on execution time, though, it's best to check to see if the file already exists.

Thread Information

Users Browsing this Thread

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

Posting Permissions

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