for(i = 0; i < lNewHeight; i++)
{
for(j = 0; j < lNewWidth; j++)
{
lpDst = (char *)lpNewDIBBits+lNewLineBytes*(lNewHeight-1-i)+j*3;
i0 = (LONG) (i / fYZoomRatio + 0.5);
j0 = (LONG) (j / fXZoomRatio + 0.5);
if( (j0 >= 0) && (j0 < lWidth) && (i0 >= 0) && (i0 < lHeight))
{//如果没超出原图范围
lpSrc =(char*)lpDIBBits+lLineBytes*(lHeight-1-i0)+j0*3;
memcpy(lpDst,lpSrc,3);
}
else
{
* ((unsigned char*)lpDst) = 255;lpDst++;
* ((unsigned char*)lpDst) = 255;lpDst++;
* ((unsigned char*)lpDst) = 255;
}
}
}
请高手指点,缩放后怎么图像变花了?
{
for(j = 0; j < lNewWidth; j++)
{
lpDst = (char *)lpNewDIBBits+lNewLineBytes*(lNewHeight-1-i)+j*3;
i0 = (LONG) (i / fYZoomRatio + 0.5);
j0 = (LONG) (j / fXZoomRatio + 0.5);
if( (j0 >= 0) && (j0 < lWidth) && (i0 >= 0) && (i0 < lHeight))
{//如果没超出原图范围
lpSrc =(char*)lpDIBBits+lLineBytes*(lHeight-1-i0)+j0*3;
memcpy(lpDst,lpSrc,3);
}
else
{
* ((unsigned char*)lpDst) = 255;lpDst++;
* ((unsigned char*)lpDst) = 255;lpDst++;
* ((unsigned char*)lpDst) = 255;
}
}
}
请高手指点,缩放后怎么图像变花了?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货