Results 1 to 5 of 5

Thread: Form Question About SCAR 3.

  1. #1
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Form Question About SCAR 3.

    Is it possible to use Pictures in the background of SCAR 3.0 forms?

    Freddy1990 maybe you could post a procedure like these.

    Code:
    procedure SafePaint;
    var
      Canvas: TCanvas;
    begin
      Canvas := GetBitmapCanvas(FormPic);
      SafeCopyCanvas(Canvas, frmDesign.Canvas, 0, 0, 500, 500, 0, 0, 500, 500);
    end;
    
    procedure PaintForm(Sender: TObject);
    begin
      SafePaint;
    end;

  2. #2
    Join Date
    Feb 2007
    Location
    USA
    Posts
    667
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Sup ice.

    Dunno if this works on 3.0 because I still haven't gotten it yet, but this is what I did on the old version.

    SCAR Code:
    FormPic : integer;//include this in global variables

    procedure SafePaint;
    var Canvas : TCanvas;
    begin
      Canvas := GetBitmapCanvas(FormPic);
      SafeCopyCanvas(canvas, frmdesign.Canvas, 0,0,318,310,0,0,318,310);//you need to adjust the numbers at the end to fit your form size
    end;

    Procedure PaintForm(sender:TObject);
    begin
      SafePaint;
    end;

    frmDesign.OnPaint:= @PaintForm;//this goes in your init form procedure. kinda like @buttonclick

    begin//main loop
    FormPic := LoadBitmap('picture.bmp');//I suppose this could go anywhere, I just put it here
    end.

    Also, note that you can do the bitmap to string thing for small images. However, I did that once before I realized how big they are, and got 10,000+ lines of bitmap string it crashed.

  3. #3
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Dunno if this works on 3.0 because I still haven't gotten it yet, but this is what I did on the old version.
    Yep, It doesn't work SCAR 3.0 is different when it comes to canvas I guess.


    Do any of the Dev know how to use it for Scar 3.0?

  4. #4
    Join Date
    Feb 2006
    Location
    London, England
    Posts
    2,045
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    Code:
    Var
      The_Canvas: TCanvas;
      The_Image: TImage;
      The_Integer: Integer;
      
    
      The_Integer := BitmapFromString(Your Bitmap Image here as a String);
      The_Image := TImage.Create(frmDesign);
      The_Image.Parent := frmDesign;
      The_Image.Left := 109;
      The_Image.Top := 10;
      The_Image.Width := 63;
      The_Image.Height := 42;
      The_Canvas := GetBitmapCanvas(The_Image);
      CopyCanvas(The_Canvas, The_Image.Canvas, 0, 0, Same as image.Width, Same as Image.Height, 0, 0, Same as image.Width, Same as Image.Height);
    That should help, stolen straight from Stress Miner
    SRL Wiki | SRL Rules | SRL Stats
    Ultimate SCAR Scripting Tutorial | Starblaster100's Auth System | Join the official SRL IRC now!


    Help Keep SRL Alive! Please disable Advert Blockers on SRL! Help Keep SRL Alive!


  5. #5
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nice!

    This just solved over 90% of my problems with scar 3. Thanks again SB.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. savesetting form question
    By gerauchert in forum OSR Help
    Replies: 7
    Last Post: 07-11-2007, 05:54 PM
  2. Tabbed Form Question
    By Aje in forum OSR Help
    Replies: 9
    Last Post: 05-27-2007, 11:58 PM
  3. Nub form question
    By $PYD3R in forum OSR Help
    Replies: 0
    Last Post: 04-01-2007, 04:50 AM

Posting Permissions

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