PDA

View Full Version : bitmap, load and save.



marmin
18-03-2005, 03:07 AM
Hi, i'm experiencing an error with this code:

form1.canvas.brush.color:=clblack;
bitmap1:=tbitmap.create;
bitmap1.loadfromfile('foo.bmp'); // a 16x16 bitmap
bitmap1.canvas.moveto[0,0;
bitmap1.canvas.lineto[5,5];
bitmap1.savetofile('foo2.bmp');

gives acces violation(runtime) in Lazarus..if I omit the moveto and lineto it works. anyone has a clue?
Thanks.

Traveler
18-03-2005, 08:26 AM
I'm spotting a minor typo in there

bitmap1.canvas.moveto(0,0);
bitmap1.canvas.lineto(5,5);

Hope that helps

marmin
19-03-2005, 06:44 PM
Yeah, it was a real stupid type error. But the code itself works in Delphi, but not in Lazarus (which I use). So it was a Lazarus problem.
:)