PDA

View Full Version : read-byte problem


jkramer
05-04-2005, 07:02 AM
Hi,

I'm trying to write a Lisp routine that reads a B/W bmp-file, and draws a construction point on a Workplane for every black pixel that's in the bmp. This way, I can "import" a bmp to OSD. I'm tired of doing all kind of tricks to get logos etc. into OSD....
Anyway, I'm using the Lisp function read-byte to read each byte of the file. This works fine UNTIL it encounters an FF byte (11111111 in binary). Ehhh.... maybe it's 2 or 3 successive FF bytes, by the way....
From that point on, each byte that is read will be FF, even if it isn't FF at all :(
Can it be that it thinks that FF is eof or something???
I attached the test-Lisp-file (beware to test it only on small files.... or be very patient....)
Anyone have a clue what's wrong???
Thanks!!!

Regards,
Jaap

clausb
05-04-2005, 11:11 AM
This is a known problem in our Lisp implementation. Please let support know about it - this will increase the priority for a fix.

Claus

jkramer
05-08-2005, 10:14 PM
Hi Claus,

thanks for your answer! I'll tell support...
Ehhh.... do you know of any way around this problem??

Thanks!
Jaap

jkramer
05-08-2005, 10:21 PM
Ooops....
hello again!
Just checked... it seems to work OK in OSD 13 (we're on OSD 11 now, but will be on 13 soon)
Anyway, you answer got me on the right track, Claus. Thanks again.
Sorry!
Regards,
Jaap

clausb
05-13-2005, 04:46 AM
Jaap,

thanks for the update. I verified this here on my end. I cannot reproduce the bug in OSDM 2005 (v13) anymore, either. Versions up to OSDM 2004 (v12) are affected, though.

Claus

jkramer
05-13-2005, 05:06 AM
Hi,

now that the macro is ready, I might as well post it :-)
Here it is.

Some remarks:
- the BMP's need to be 2-color (B/W)
- drawing a C-point is fairly slow, so the more pixels, the longer it takes! So, try it on a small BMP first...
- you can choose whether black or white pixels drawn on the Workplane

Regards,
Jaap