<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1141" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2>Hi,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I am having trouble with 16-colors bitmaps<SPAN 
class=110014214-30042003> </SPAN>(4 bits) and i was wondering<SPAN 
class=110014214-30042003> </SPAN>at how GDAL manages this format. I get a 
bitmap&nbsp;<SPAN class=110014214-30042003>w</SPAN>here the pixels values<SPAN 
class=110014214-30042003> </SPAN>seem to have been slighly<SPAN 
class=110014214-30042003> shifted </SPAN>and the result is far from what i<SPAN 
class=110014214-30042003> </SPAN>expected.<SPAN class=110014214-30042003> 
</SPAN>This problem does also occur with monochrome bitmaps. So far i 
successfully<SPAN class=110014214-30042003> </SPAN>read 256<SPAN 
class=110014214-30042003> </SPAN>colors bitmaps and, gifs,<SPAN 
class=110014214-30042003> </SPAN>jpegs, and the other raster formats supported 
by<SPAN class=110014214-30042003> </SPAN>GDAL.It seems clear to me that the fact 
that the pixels are defined on 1 or 4<SPAN class=110014214-30042003> 
</SPAN>bits<SPAN class=110014214-30042003> </SPAN>rather than a byte causes 
this<SPAN class=110014214-30042003> </SPAN>misalignment.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN class=110014214-30042003>I'm using 
Windows and m</SPAN>y current procedure is to use a BITMAPINFO structure, and 
fill the pixel<SPAN class=110014214-30042003> </SPAN>values<SPAN 
class=110014214-30042003> </SPAN>buffer with GDALDataset::RasterIO(...). This 
works for all the raster images<SPAN class=110014214-30042003> </SPAN>i 
tried.<SPAN class=110014214-30042003> </SPAN>So, to get to the point, i want to 
know how RasterIO actually fills the<SPAN class=110014214-30042003> 
</SPAN>buffer when<SPAN class=110014214-30042003> </SPAN>reading 4 bits 
bitmap.</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT><FONT face=Arial size=2><SPAN 
class=110014214-30042003>Thanks.</SPAN></FONT></FONT></DIV>
<P align=left><FONT face=Arial size=2>Sylvain Rioux<BR><BR>Les technologies 
SoftMap (2002) inc.<BR>4<SPAN class=430292114-10012003>0</SPAN>0, boul. 
Jean-Lesage, b<SPAN class=430292114-10012003>ureau 
540</SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>Québec 
(Québec)<BR>Canada G1K 8<SPAN class=430292114-10012003>W1</SPAN><BR><BR>Tél. : 
(418) 523-2929, poste&nbsp;<SPAN class=430292114-10012003>304</SPAN><BR>Téléc. : 
(418) 523-7979<BR><A href="mailto:sylvain.rioux@softmaptech.com"><FONT 
face=Arial color=#000000 size=2>sylvain.rioux@softmaptech.com</FONT></A><BR><A 
href="http://www.softmaptech.com/"><FONT face=Arial color=#000000 
size=2>www.softmaptech.com</FONT></A><BR></FONT></P>
<DIV>&nbsp;</DIV></BODY></HTML>