[Oberon] Incorrect bitmap header with BMPEncoder.WriteImage() in
AosBMPCodec.Mod
Yaroslav Romanchenko
tobject at bk.ru
Sat Apr 28 09:50:22 MEST 2007
Hi All,
BMPEncoder.WriteImage() makes bitmap header regardless of additional
sizes of color masks.
Incorrect piece:
(* Bitmap file header *)
out.String("BM");
out.RawLInt(14 + 40 + palentries * 4 + dataSize);
out.RawLInt(0); out.RawLInt(14 + 40 + palentries * 4);
After correction:
(* Bitmap file header *)
out.String("BM");
IF (img.fmt.code = Raster.bgra8888) OR (img.fmt.code =
Raster.bgr888) OR (img.fmt.code = Raster.bgr466) OR
(img.fmt.code = Raster.bgr555) OR (img.fmt.code =
Raster.bgr565)
THEN
(* regard the additional size of color masks *)
out.RawLInt(12 + 14 + 40 + palentries * 4 + dataSize);
out.RawLInt(0); out.RawLInt(12 + 14 + 40 + palentries * 4);
ELSE
out.RawLInt(14 + 40 + palentries * 4 + dataSize);
out.RawLInt(0); out.RawLInt(14 + 40 + palentries * 4);
END;
--
Cheers, SAGE
http://sage.com.ua/
More information about the Oberon
mailing list