When rendering a PPTX slide to a bitmap, text elements are shifted up in the resulting image. The ammount of displacement seems to vary depending on the device display scaling set in Windows 10.
Using the following code to render this presentation TEST.zip (68,6 Ko) :
var bmp = new Bitmap(targetSize.Width, targetSize.Height);
rc = new RenderContext
{
Size = targetSize,
Bitmap = bmp,
Graphics = Graphics.FromImage(bmp)
};
slide.RenderToGraphics(renderingOptions, rc.Graphics, rc.Size);
… produces the following image on a device with 225% display scaling (note the shadow on the image on the right): image.png (58,1 Ko)
Updating the code to force a dpi of 96 on the bitmap… :
var bmp = new Bitmap(targetSize.Width, targetSize.Height);
**bmp.SetResolution(96, 96);**
rc = new RenderContext
{
Size = targetSize,
Bitmap = bmp,
Graphics = Graphics.FromImage(bmp)
};
slide.RenderToGraphics(renderingOptions, rc.Graphics, rc.Size);
… fixes the text rendering, but effects image shadows, that get shrinked : image.jpg (58,9 Ko)
@Excense,
Thank you for your patience. I opened the Parameters / System / Display settings, set the Scalling to 225%, and performed the slide to bitmap conversions, but I was unable to reproduce the problems you described.
Please share the full standalone code example or sample project and describe in more detail how to reproduce the issue on our end.
Sorry for not mentionning it in the original post, this app was headless and a WPF app for legacy reasons.
We were able to get correct renders by changing our app to use a standard Main() entrypoint instead of launching a WPF Application.
The issue is not impacting us anymore after this change, but persists for .Net WPF apps. Here is a sample WPF app that demonstrate the issue should you wish to continue investigations:
@Excense,
Thank you for the additional information. I’ve reproduced the problems you described when converting the PowerPoint slide to images using the WPF application.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): SLIDESNET-44324
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
The issues you found earlier (filed as SLIDESNET-44324) have been fixed in Aspose.Slides for .NET 24.3 (ZIP, MSI).
You can check all fixes on the Release Notes page.
You can also find the latest version of our library on the Product Download page.