Recent

Author Topic: bitmap, load and save.  (Read 15267 times)

marmin

  • Jr. Member
  • **
  • Posts: 86
    • http://www.naton.org
bitmap, load and save.
« on: March 18, 2005, 12:21:13 am »
Problem!


  form1.canvas.brush.color:= clBlack;
  BitMap1 := TBitMap.create;
  Bitmap1.Loadfromfile('test1.bmp');  
  bitmap1.canvas.moveto(1,1); bitmap1.canvas.lineto(4,4);
  bitmap1.savetofile('test2.bmp');

gives'Acces Violation' run-time error , when writing.
If I omit the pixel edit , things work perfectly.
Could this be anything to do with a DDB? help.
Marmin^.Style
Location: Pointer Land!

Lightning

  • Sr. Member
  • ****
  • Posts: 422
bitmap, load and save.
« Reply #1 on: March 18, 2005, 12:01:45 pm »
What version of Laz/FPC are you using ?
The future must be... Fast and OpenSource so...
Think Open and Lightning Fast!

marmin

  • Jr. Member
  • **
  • Posts: 86
    • http://www.naton.org
bitmap, load and save.
« Reply #2 on: March 18, 2005, 08:48:13 pm »
ohoh.. This is a Lazarus bug.

I have just tested the same code in Delphi 6 and it's working fine.
Marmin^.Style
Location: Pointer Land!

marmin

  • Jr. Member
  • **
  • Posts: 86
    • http://www.naton.org
bitmap, load and save.
« Reply #3 on: March 19, 2005, 04:34:20 am »
ah i d-loaded the latest snapshot and it's fixed ! nice work. cuz I was working on a nice Lazarus Icon Editor-
 
bitmaps still give strange color conversion results.

- what is the format of an Icon for Linux?
- how can I convert tcolor to tfpcolor?
Marmin^.Style
Location: Pointer Land!

Nisbo

  • New Member
  • *
  • Posts: 19
bitmap, load and save.
« Reply #4 on: March 19, 2005, 02:14:32 pm »
mmmm sorry but it doesnt work on my site

Image1.Picture.Bitmap.SaveToFile('TestBitmap.bmp');

TestBitmap.bmp is a black picture :(

Nisbo

  • New Member
  • *
  • Posts: 19
bitmap, load and save.
« Reply #5 on: March 21, 2005, 04:45:18 pm »
no idea ? Bitmap --> SaveToFile buggy ?

marmin

  • Jr. Member
  • **
  • Posts: 86
    • http://www.naton.org
bitmap, load and save.
« Reply #6 on: March 21, 2005, 07:35:42 pm »
I don't think it's the savetofile. (I'm working in win32).
The problem occurs when doing a canvas operation, like rectangle.
Saving the win32 bitmap gives strange color results.
xpm files editing, loading and saving, however, work.
Marmin^.Style
Location: Pointer Land!

 

TinyPortal © 2005-2018