Results 1 to 7 of 7

Thread: Tcanvas Help

  1. #1
    Join Date
    Sep 2010
    Location
    Azeroth
    Posts
    395
    Mentioned
    0 Post(s)
    Quoted
    17 Post(s)

    Default Tcanvas Help

    Simba Code:
    program new;
    var
    q1:tbitmap;
    q2:TMufasaBitmap;
    q3:integer;
    begin
      ClearDebugImg ;

      q3:=CreateBitmap(10,10);
      q2:=GetMufasaBitmap(q3);
      q2.FastDrawClear (clwhite);



      q2.DrawToCanvas(0,0,q1.Canvas);



      DisplayDebugImgWindow (100,100);
    end.

    can someone help me fix this error?

  2. #2
    Join Date
    Feb 2012
    Location
    Florida
    Posts
    193
    Mentioned
    1 Post(s)
    Quoted
    6 Post(s)

    Thumbs up

    Mmm, forgot about that display window thingy. I guess I could use that for drawing, and text too on stuff other then smart. Tell us what your error is. The DrawBitmapDebugImg(bmp); I know works you could use that. I wish someone could get this working though. Made my own thread about it before urs. The whole TCanvas stuff. Someone needs to explain it, then we can move it to tutorials and sticky it maybe.
    Last edited by LordJashin; 03-01-2012 at 10:47 PM.

  3. #3
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    The var q1 isn't set.

    Simba Code:
    program new;
    var
    q1:tbitmap;
    q2:TMufasaBitmap;
    q3:integer;
    c:TCanvas;
    begin
      ClearDebugImg ;

      q3:=CreateBitmap(10,10);
      q2:=GetMufasaBitmap(q3);
      q2.FastDrawClear (clwhite);

      q1 := q2.ToTBitmap;

      q2.DrawToCanvas(0,0,q1.Canvas);

      DisplayDebugImgWindow (100,100);
    end.
    Working on: Tithe Farmer

  4. #4
    Join Date
    Sep 2010
    Location
    Azeroth
    Posts
    395
    Mentioned
    0 Post(s)
    Quoted
    17 Post(s)

    Default

    Simba Code:
    program new;
    var
    tbmp,tbmp2:tbitmap;
    mbmp,mbmp2:TMufasaBitmap;
    bmp,bmp2:integer;
    c:TCanvas;



    begin

    ClearDebugImg ;

      bmp:=CreateBitmap(100,100);
      mbmp:=GetMufasaBitmap(bmp);
      mbmp.FastDrawClear (clwhite);
      tbmp := mbmp.ToTBitmap;
      c:=tbmp.Canvas
      mbmp.DrawToCanvas(0,0,c);

      bmp2:=CreateBitmap(10,10);
      mbmp2:=getmufasabitmap(bmp2);
      mbmp2.FastDrawClear(16777215);
      tbmp2:=mbmp2.ToTBitmap;
      mbmp2.DrawToCanvas(0,0,c)





      DisplayDebugImgWindow (100,100);

    end.


    i swear im totally headed in the wron direction, I am trying to get that 10 by 10 block to appear on the canvas but dang i cannot figure out how to draw it

  5. #5
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    Just use DrawBitmap

    edit:
    You are aware you miss DrawBitmapDebugImg(btm:integer)?
    Last edited by masterBB; 03-02-2012 at 12:09 AM.
    Working on: Tithe Farmer

  6. #6
    Join Date
    Feb 2012
    Location
    Florida
    Posts
    193
    Mentioned
    1 Post(s)
    Quoted
    6 Post(s)

    Default

    Here's an example:

    Simba Code:
    program new;

    var
      Bmp: Integer;

    begin
      ClearDebugImg;
    Bmp := LoadBitmap('C:\Test.bmp');
      DrawBitmapDebugImg(Bmp);
      DisplayDebugImgWindow(250,250);
    end.

  7. #7
    Join Date
    Sep 2010
    Location
    Azeroth
    Posts
    395
    Mentioned
    0 Post(s)
    Quoted
    17 Post(s)

    Default

    yes i no in my example i did not use drawbutmapdebugimg... i have use it and got a little thing running n all but was supah buggy laggy slow.

    that why i came to the canvas class because i was hopefully thinking proper use of it will get it up nice and smooth ...

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
  •