Log in

View Full Version : Tcanvas Help



wantonman
03-01-2012, 09:40 PM
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?

LordJashin
03-01-2012, 10:36 PM
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.

masterBB
03-01-2012, 10:40 PM
The var q1 isn't set.

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.

wantonman
03-02-2012, 12:01 AM
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

masterBB
03-02-2012, 12:07 AM
Just use DrawBitmap

edit:
You are aware you miss DrawBitmapDebugImg(btm:integer)?

LordJashin
03-02-2012, 12:29 AM
Here's an example:

program new;

var
Bmp: Integer;

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

wantonman
03-04-2012, 04:43 AM
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 ...