Results 1 to 5 of 5

Thread: convert canvas to bitmap

  1. #1
    Join Date
    Mar 2007
    Posts
    107
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default convert canvas to bitmap

    anyway to do this? tell me plz

  2. #2
    Join Date
    May 2006
    Posts
    1,230
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    never tested it, but i made a function for you.
    where the bitmap has to be already declared, as in
    bitmap := BitmapFromString(100, 100, ''); or a previously used bitmap;
    it copys part of the canvas on how big the bitmap is.

    the most reasonable way of drawing without needing to use this function is
    u draw on a bitmap, and once your done, you draw the bitmap on the canvas
    to draw on a bitmap the most easy technique is fastsetpixel or GetBitmapCanvas(bitmap);

    anyways
    SCAR Code:
    function CanvasToBitmap(var Bitmap : integer; Canvas : TCanvas) : boolean;
    var
      w, h : integer;
    begin
      try
        GetBitmapSize(Bitmap, w, h);
        SafeCopyCanvas(Canvas, GetBitmapCanvas(Bitmap), 0, 0, w, h, 0, 0, w, h);
        Result := True;
      except
         Writeln('[Runtime Error] In CanvasToBitmap, probally bitmap or canvas does not exist!!');
      end;
    end;

  3. #3
    Join Date
    Jun 2007
    Location
    I'm not sure...
    Posts
    581
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Great job The_RS_Monkey. It at least looks like it works (haven't tested it either XD). SRL needs a proc like this in it.
    ---------------------------------------------------------


    Pm me if you need any math functions made. Me = l0ving t3h mathz

    ---------------------------------------------------------

  4. #4
    Join Date
    Mar 2007
    Posts
    107
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    wow thank you so much, i had no idea that you could do that

  5. #5
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    There's a CopyCanvasToBitmap in scar
    I made a new script, check it out!.

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. Canvas / bitmap help
    By HISTORY in forum OSR Help
    Replies: 6
    Last Post: 11-14-2007, 08:16 PM
  3. what do i DO (convert 3.11 to 3.12 script)
    By P1nky in forum OSR Help
    Replies: 2
    Last Post: 09-28-2007, 12:07 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
  •