BMP的讀取32Bit 的值 找了許久..
以下是程式碼,請參考
bool GetBmpWidthHeight(const wxChar* buf,int size,int&Width,int& Height,bool& ReadWidthHeight)
{
if(size < 26)
{
ReadWidthHeight = false;
return false;
}
width =(BYTE)buf[21] << 24;
height =(BYTE)buf[25] << 16;
readwidthheight=true;
}
以上 , 不負責讀取所有格式,另有問題概不負責.
歡迎轉載並請標明出處.謝謝
參考:
http://www.google.com/codesearch?hl=en&q=+lang:c%2B%2B+read+bmp+width+-img+show:MSwKpY23o4k:RjXxUM8aNXA:UKPc_fAe5nA&sa=N&cd=2&ct=rc&cs_p=ftp://ftp.idsoftware.com/idstuff/source/GtkRadiant-GPL.zip&cs_f=GPL/GtkRadiant/plugins/image/bmp.cpp#a0
http://www.google.com/codesearch?hl=zh-TW&q=+lang:c%2B%2B+read+bmp+width+%3C%3C+-img+show:aqffVhSjOiA:HMWZi5kbbPk:khnt1EYmZBw&sa=N&cd=6&ct=rc&cs_p=http://gentoo.osuosl.org/distfiles/BillardGL-1.75.tar.gz&cs_f=BillardGL-1.75/src/bmp.cpp#a0
沒有留言:
張貼留言