Graphics::D rawImage 与 ImageAttributes 在将 PNG 或 JPEG 图像绘制到打印机时速度缓慢

本文提供了一个解决方法,说明在使用对象调用该方法时该方法ImageAttributes显示缓慢的问题Graphics::DrawImage,以将 JPEG 或 PNG 图像绘制到打印机。

原因

当使用对象调用源图像时,该方法 Graphics::DrawImage 会将源图像转换为与设备无关的 ImageAttributes 位图(DIB)。

解决方法

若要解决此问题,请使用参数集调用Graphics::DrawImageImageAttributesNULL除非需要指定ImageAttributes对象。

打印机支持时,Graphics::DrawImageImageAttributes调用参数NULL设置为将源 JPEG 或 PNG 直接传递到打印机。

详细信息