指定された大きさに納まるように、元デバイスコンテキストから均等倍して画像を縮小コピーする関数です。
void stc(HDC d,int w,int h,HDC f)
{
BITMAP b; float x,y,i;
GetObject((HBITMAP)GetCurrentObject(f,OBJ_BITMAP),sizeof(BITMAP),&b);
x=b.bmWidth; y=b.bmHeight;
if(x>w){ i=w/(x/100); x=(x/100)*i; y=(y/100)*i; }
if(y>h){ i=h/(y/100); x=(x/100)*i; y=(y/100)*i; }
SetStretchBltMode(d,COLORONCOLOR);
StretchBlt(d,0,0,x,y,f,0,0,b.bmWidth,b.bmHeight,SRCCOPY);
}