Note that there are some explanatory texts on larger screens.

plurals
  1. POIs StretchBlt HALFTONE == BILINEAR for all scaling?
    text
    copied!<p>Can anyone clarify if the GDI <a href="http://msdn.microsoft.com/en-us/library/dd145120(VS.85).aspx" rel="nofollow noreferrer">StretchBlt</a> function for the workstation Win32 API performs bilinear interpolation for scaling to <strong>both</strong> larger and smaller images for 24/32-bit color images? And if not, is there a GDI (<em>not</em> GDI+) function that does this?</p> <p>The <a href="http://msdn.microsoft.com/en-us/library/dd145089(VS.85).aspx" rel="nofollow noreferrer">SetStretchBltMode</a> fn has a setting <strong>HALFTONE</strong> which is documented as follows:</p> <blockquote> <p><strong><em>HALFTONE</em></strong> Maps pixels from the source rectangle into blocks of pixels in the destination rectangle. The average color over the destination block of pixels approximates the color of the source pixels.</p> </blockquote> <p>I've seen <a href="https://stackoverflow.com/questions/1117537/how-to-improve-drawdibs-quality">references (see follow-up to first answer)</a> that this performs bilinear interpolation when scaling down an image, but no clear answer of what happens when scaling up.</p> <p>I have noticed that the <a href="http://msdn.microsoft.com/en-us/library/aa933043.aspx" rel="nofollow noreferrer">Windows Mobile CE SDK does support a BILINEAR flag</a> - which is documented exactly opposite of the HALFTONE comments (only works for scaling up).</p> <p>Note that for the scope of this question, I'm not interested in pursuing GDI+ (which has numerous interpolation options), OpenGL, DirectX, etc. as alternatives, so please don't bother with follow-ups regarding these other APIs or alternate image libraries.</p> <p>What I'm really hoping to find is some definitive MS/MSDN or other high-quality documentation that clearly documents this behavior of the Win32 (desktop) GDI behavior.</p> <p>Meanwhile, I'll try some experiments comparing GDI vs. Direct2D (which does have an explicit flag to control this) and post my findings.</p> <p>Thanks!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload