开发者

BMP image generated But displayed inverted

I have generated bitmap.dll through winddk.

Added manually as a printer driver selecting print-to-file driver.

Using this I create 开发者_开发百科an image of my document using print command from file.

I am able to create image and view it, But the problem is that I get inverted(mirror) image.

cScans = pOemPDEV->bmInfoHeader.biHeight;
// Flip the biHeight member so that it denotes top-down bitmap 
pOemPDEV->bmInfoHeader.biHeight = cScans * -1;

Have anyone workaround of this code? As I get the problem when I comment(to get header properly generated) this lines.


Device Independent Bitmaps are documented as being laid out in memory with the bottom line at the start of the buffer. Its an experiment in cartesian co-ordinates perpetrated by the designers of OS/2 who were working with Microsoft at the same time Windows 3 was being developed.

There are two possible fixes:

  1. Generate your buffer upside down.
  2. Many Windows APIs that take a BITMAPINFO treat a negative biHeight value to mean a top down DIB.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜