Results 1 to 3 of 3

Thread: bitmap, load and save.

  1. #1

    bitmap, load and save.

    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.
    Marmin^.Style

  2. #2

    bitmap, load and save.

    I'm spotting a minor typo in there

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

    Hope that helps

  3. #3

    bitmap, load and save.

    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.
    Marmin^.Style

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •