typedef struct tagBITMAPINFOHEADER{ DWORD biSize; LONG biWidth; LONG biHeight; WORD biPlanes; WORD biBitCount; DWORD biCompression; DWORD biSizeImage; LONG biXPelsPerMeter; LONG biYPelsPerMeter; DWORD biClrUsed; DWORD biClrImportant; } BITMAPINFOHEADER, *PBITMAPINFOHEADER; 中的 LONG biXPelsPerMeter; LONG biYPelsPerMeter;
你头像是多少DPI的,哈哈
DPI是指定 1英寸有多少个点. 不同的分辨率下的DPI应该不同吧.
DWORD biSize;
LONG biWidth;
LONG biHeight;
WORD biPlanes;
WORD biBitCount;
DWORD biCompression;
DWORD biSizeImage;
LONG biXPelsPerMeter;
LONG biYPelsPerMeter;
DWORD biClrUsed;
DWORD biClrImportant;
} BITMAPINFOHEADER, *PBITMAPINFOHEADER;
中的
LONG biXPelsPerMeter;
LONG biYPelsPerMeter;
正解 DPI 根据显示效果而不同...例如你图形是300*300 如果打印出来上是1英寸那就是PDI300 打印是3英寸的为PDI100
.. DPI是和设备相关和你图象没什么关系.
{
FileStream _FileStream = new FileStream(p_BMPFullFile, FileMode.Open, FileAccess.Read);
BinaryReader _Binary = new BinaryReader(_FileStream);
_Binary.BaseStream.Position = 38; uint _IntX = _Binary.ReadUInt32();
uint _IntY = _Binary.ReadUInt32(); if (_IntX == 0) x = 96;
if (_IntY == 0) y = 96; x = (int)(_IntX / 40) + 1;
y = (int)(_IntY / 40) + 1; _FileStream.Close();
}
我这里很多BMP 都是0 但显示为96
弹出来看看