RichText Content Not Display Properly

Stimulsoft Reports.NET discussion
Lech Kulikowski
Posts: 6238
Joined: Tue Mar 20, 2018 5:34 am

Re: RichText Content Not Display Properly

Post by Lech Kulikowski »

Hello,

Thank you for results. We need some additional time to check the issue.

Thank you.
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Re: RichText Content Not Display Properly

Post by Ivan »

Hello.

We have done some testing.
Please try to use the following code:

Code: Select all

			Bitmap bmp = new Bitmap(1, 1);
			bmp.SetResolution((float)(96 * StiDpiHelper.GraphicsRichTextScale), (float)(96 * StiDpiHelper.GraphicsRichTextScale));
			Graphics grr = Graphics.FromImage(bmp);
			grr.PageUnit = GraphicsUnit.Pixel;
			grr.PageScale = 1f;
			StiReport.GlobalRichTextMeasureGraphics = grr;
Thank you.
kennynjc
Posts: 34
Joined: Thu Dec 14, 2017 5:24 am

Re: RichText Content Not Display Properly

Post by kennynjc »

Hi,

Your code only work if the Scale is larger than 100%. When the scale = 100% the RichText would be out

Converted in VB.NET

Code: Select all

Dim bmp As New Bitmap(1, 1)
        bmp.SetResolution((96 * StiDpiHelper.GraphicsRichTextScale), (96 * StiDpiHelper.GraphicsRichTextScale))

        Dim myReportGlobalRichTextMG As Graphics = Graphics.FromImage(bmp)
        myReportGlobalRichTextMG.PageUnit = GraphicsUnit.Pixel
        myReportGlobalRichTextMG.PageScale = 1.0F
        StiReport.GlobalRichTextMeasureGraphics = myReportGlobalRichTextMG
Attachments
Report Header.png
Report Header.png (40.39 KiB) Viewed 2558 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: RichText Content Not Display Properly

Post by HighAley »

Hello.

We have found an issue in the StiDpiHelper.GraphicsRichTextScale method.
The system scale was not always right.
The fix will be available in our next build on July.

Thank you.
kennynjc
Posts: 34
Joined: Thu Dec 14, 2017 5:24 am

Re: RichText Content Not Display Properly

Post by kennynjc »

Hi,
I'd tried with the new release 2018.2.3 and the problem only gone for my machine. But, for most of my customer with Windows 10 Text Scale is 100%, it doesn't work and the RichText Header became presented in very large. However, I noticed that there will be no problem if their Text Scale being set to 125%.

I dont understand why my machine work for below code but some others become worst.
Dim bmp As New Bitmap(1, 1)
bmp.SetResolution((96 * StiDpiHelper.GraphicsRichTextScale), (96 * StiDpiHelper.GraphicsRichTextScale))

Dim myReportGlobalRichTextMG As Graphics = Graphics.FromImage(bmp)
myReportGlobalRichTextMG.PageUnit = GraphicsUnit.Pixel
myReportGlobalRichTextMG.PageScale = 1.0F
StiReport.GlobalRichTextMeasureGraphics = myReportGlobalRichTextMG


Please advise.
Thank you.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: RichText Content Not Display Properly

Post by HighAley »

Hello.

It's very strange. We tested our product on several different machines.
Please, run the attached application on the machine with the issue.

Send us the Text Scale that is set in the system and the output of this application.

Thank you.
Attachments
DpiAwareOff.zip
(6.85 KiB) Downloaded 140 times
Post Reply