Results 1 to 3 of 3

Thread: get bitmap width during runtime

  1. #1
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default get bitmap width during runtime

    Hello

    I have just started to learn about canvases and i want to put some text on the debug screen
    if i use this
    SCAR Code:
    bmp:=CreateBitmapFromText('Hello', UpChars, 16777215);
    how would i find the width of bmp?
    if i run this then it comes out fine
    SCAR Code:
    program canvas;
    var
      bmp:integer;
      DebugCanvas,BmpCanvas:TCanvas;
    begin
      DisplayDebugImgWindow(300,300);
      Bmp:=CreateBitmapFromText('Hello', UpChars, 16777215);
      DebugCanvas:=getdebugcanvas;
      BmpCanvas:=GetBitmapCanvas(Bmp);
      Copycanvas(BmpCanvas,DebugCanvas,0,0,30,30,10,10,40,40);
    end.
    but if i change the string to a longer one then it will only show part of the bitmap like so
    SCAR Code:
    program canvas;
    var
      bmp:integer;
      DebugCanvas,BmpCanvas:TCanvas;
    begin
      DisplayDebugImgWindow(300,300);
      Bmp:=CreateBitmapFromText('Hello how are you today?', UpChars, 16777215);
      DebugCanvas:=getdebugcanvas;
      BmpCanvas:=GetBitmapCanvas(Bmp);
      Copycanvas(BmpCanvas,DebugCanvas,0,0,40,30,10,10,60,40);
    end.
    if you dont understand what i mean then i will try to explain a bit better
    if you can help m and you know how o do it then thank you
    ~shut

  2. #2
    Join Date
    Mar 2007
    Posts
    3,042
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    GetBitmapSize will put the width and height of the bitmap into the Width and Height variables you give the procedure.
    :-)

  3. #3
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Find Bitmap in Bitmap file
    By fORCE_wORKS in forum RS3 Outdated / Broken Scripts
    Replies: 8
    Last Post: 12-13-2007, 11:04 PM
  2. Bitmap Help.
    By Bourdou! in forum OSR Help
    Replies: 13
    Last Post: 08-16-2007, 02:38 AM
  3. Bitmap Help!
    By dialeyj2 in forum OSR Help
    Replies: 12
    Last Post: 06-13-2007, 05:35 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
  •