Gdiplus::Graphics graphics(pdc->m_hDC);
graphics.SetInterpolationMode(Gdiplus::InterpolationModeHighQuality);
graphics.SetPageUnit(Gdiplus::UnitPixel);
.
.
.
status = graphics.DrawImage(piImage, destinationPoints, 3);
The status returns OutOfMemory, even for small images.
There is no problem if the image is not rotated (probably because no
interpolation is required?) yet even for very small rotations, the DrawImage
runs out of memory, or sometimes will work, but be very very slow in printing.
Any ideas what is happening in the GDI+ DrawImage function that is causing
this problem and how to fix it?
Regards
Tony
=?Utf-8?B?bGlzdGVjaHRvbnk=?= <liste...@discussions.microsoft.com> spake the secret code
<9D79E25B-6695-4762...@microsoft.com> thusly:
>I am attempting to print a rotated image using GDI+. [...]
You should try a GDI/GDI+ newsgroup. This newsgroup is for DirectX
Graphics (i.e. Direct3D).
--
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
<http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/>
Legalize Adulthood! <http://legalizeadulthood.wordpress.com>
> There is no problem if the image is not rotated (probably because no
> interpolation is required?) yet even for very small rotations, the DrawImage
> runs out of memory, or sometimes will work, but be very very slow in printing.
>
> Any ideas what is happening in the GDI+ DrawImage function that is causing
> this problem and how to fix it?
This is a bug in GDI+. Instead of rotate it by 90.0, 180.0 etc, try 90.0001
or 180.0001. The result is the same, but it does not trigger the bug.
best
doc