문제

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.
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top