Moire effect
-
Does anyone meet the sitation when a image with many horizontal lines, with low levels zoom (when image is fit to window), is seen with moire effect ? And the drawing is made in classic way:
...
pDC->SetStretchBltMode(COLORONCOLOR);
pDC->StretchBlt(xDst, yDst, nDstWidth, nDstHeight, pMemDC, xSrc, ySrc, nSrcWidth, nSrcHeight, SRCCOPY);
...I had tried with stretch mode HALFTONE, with the same results ... After all, I dind't know where the problem come ... (P.S. I draw with GDI).
-
Does anyone meet the sitation when a image with many horizontal lines, with low levels zoom (when image is fit to window), is seen with moire effect ? And the drawing is made in classic way:
...
pDC->SetStretchBltMode(COLORONCOLOR);
pDC->StretchBlt(xDst, yDst, nDstWidth, nDstHeight, pMemDC, xSrc, ySrc, nSrcWidth, nSrcHeight, SRCCOPY);
...I had tried with stretch mode HALFTONE, with the same results ... After all, I dind't know where the problem come ... (P.S. I draw with GDI).
-
Thank you, I doubt that you have an VC6 version of your project ... :) Do you ? And one thing, what is the source of the problem ? From where the problem came from ?
Nope. However, the
DLL
project contains just two important files, namelyresample.c
andresample.h
. You may generate aDLL
project skeleton viaVisual Studio 6 Application Wizard
and then add such files to it (probably you have to replace the generated header and source). It should be simple. You may even embed theresample.c
andresample.h
content directly into your project (that is without the need of loading theDLL
).Veni, vidi, vici.
-
Does anyone meet the sitation when a image with many horizontal lines, with low levels zoom (when image is fit to window), is seen with moire effect ? And the drawing is made in classic way:
...
pDC->SetStretchBltMode(COLORONCOLOR);
pDC->StretchBlt(xDst, yDst, nDstWidth, nDstHeight, pMemDC, xSrc, ySrc, nSrcWidth, nSrcHeight, SRCCOPY);
...I had tried with stretch mode HALFTONE, with the same results ... After all, I dind't know where the problem come ... (P.S. I draw with GDI).
It looks like someone has given you a solution, so I'll explain a bit why this happens. The resizing of your image using GDI is a simple re-sampling algorithm. When you shrink it, pixels in a horizontal and vertical direction are removed, at a semi regular spacing, to make the image fit the new size. This has the effect of producing a horizontal and vertical waveform in your image. Your parallel lines in the image, also make up a wave pattern. When these two wave patterns interact, you get an interference pattern and see the Moire' effect. http://en.wikipedia.org/wiki/Moire_effect[^]