Bug 3849

Datawindow paint (GDI) - print doesn't match visual, in some case doesn't print graphic at all. 07 April, 2021

Michal Kulakovsky
08 January, 2020
Product: PowerBuilder Category: DataWindow
Version: 2019 Build:
Classification: Sybase (legacy) bug Publishing: Public
Priority: P3
Status: Scheduling Reason:
Baron Zhang @Appeon 07 April, 2021
Hi Michal,

We can reproduce this issue and we’ve submitted the issue to our development team for further analysis for a solution. 
BTW, PB 12.6 also has the same behavior.

Ken Guo @Appeon 09 January, 2020
Hi Michal,

Thank you for providing this case, I can reproduce the problem you said locally.
We made a preliminary analysis, and we can't fix it in a short time. We will analyze it further.

Michal Kulakovsky 09 January, 2020
DataWindowPaint.zip (52KB)

Project - added.
As You can see in datawindow is Violet square but when you Print it out this square is missing.
Interesting thing is, that Bitmap loaded via LoadImage from file and paint via StretchBlt is printed well....
Square is  created in memory with CreateBitmap and buffer.

Take a look at text size (TextOutA)  on screen and on printer ..... size is very different.

Source for DLL function is in paint_on_dc.cpp 

I didn't find the reason of this behaviour.
Ken Guo @Appeon 08 January, 2020
Hi Michal,

In order to better understand and analyze this issue, it would be very helpful if you could provide a small complete reproducible case for us. Thanks for your understanding.

Michal Kulakovsky 08 January, 2020
Datawindow paint function  calls external DLL that paints on HDC. This DLL paints on HDC via functions StretchBlt or BitBlt, till now everything is OK, graphics looks good,
but problem happen when printing ... Instead of graphics, there is only white space - no graphic.
When I paint on HDC in PB via external functions like CreateEllipticRgn or CreatePolygonRgn,
then print prints something what is similar, but not the same graphic. TextOutA ..... is not print correctly at all.

*Reproduce Steps:
Create DLL to paint on HDC using StretchBlt , BitBlt. Use this function in paint (computed field) DW and try to print it out ...

Windows 10
Database Type:
Database Version: