Hi, I have a datawindow (A4 papersize for printing and no margins) and use a .jpg file for the background picture (Brush mode 6 Picture). The jpg is a 300dpi 2480x3507 (A4). When I use Tile mode 0 (Original size) then the picture is not shown at all. Not in the IDE 2022 and not at runtime. When I use another tile mode the picture is a bit stretched and there are margins around it. Can anyone help me with this?
- You are here:
- Home
- Q&A
- Q&A
- PowerBuilder
- Tile mode on datawindow background picture file
- Richard Smit
- PowerBuilder
- Monday, 22 May 2023 19:20 PM UTC
- Wednesday, 24 May 2023 18:54 PM UTC
- PowerBuilder
- # 1
Hi Richard;
FYI: Tiling also depends on the Scale.X and Scale.Y values.
Can you give us more details & better yet, a small test case PB App that replicates your exact problem?
Regards ... Chris
- Tuesday, 30 May 2023 20:20 PM UTC
- PowerBuilder
- # 2
Hi Chris,
Thanks for your response!
Attached a simple application with a window and datawindow control. The datawindow control has a picture as a background. Tile mode 0 original size does not work (shows nothing). I do not understand why. Tile mode 4 Stretch to fit seems to work but I am not sure about it regarding margins and result of the shape compared tot the original JPG.
Why does tile mode 0 not work?
You can run the application.
thx
Richard
- Chris Pollach @Appeon
- Wednesday, 31 May 2023 18:53 PM UTC
Thank you for the test case! I now see what the problem from your perspective. The use of the DWO's "background mode" though was more for creating a "banding" effect in the DWO's background rather than a full size image as wallpaper. However, I think that Miguel is correct about resizing the image to properly fit in the DWO area. I would suggest setting the DWO's units to either Inches or CM's and then use an imaging program to resize the image to that exact size as well. Then in the DWO, set the background image mode to "original size". Having the image in "stretch" mode currently *will* distort it depending on the size of the DW Control area or worse, when the PDF is created using the default printer settings.
HTH
Regards ... Chris
-
Helpful Loading... Helpful 0
- Tuesday, 30 May 2023 20:56 PM UTC
- PowerBuilder
- # 3
Hi,
Your example jpg file has a resolution waaaaay bigger than what would fit on an A4 sheet. That might explain why mode 0 doesn't show anything.
I was wrong with previous statement: https://www.a4-size.com/a4-size-in-pixels/?size=a4&unit=px&ppi=300
regards
- Tuesday, 30 May 2023 22:08 PM UTC
- PowerBuilder
- # 4
I've been playing around with your sample app. If you reduce the image size to 30% of its original size (using Paint), mode 0 works!
Apart from not having ANY documentation on the values for Tile Mode, since when this was introduced in PB 11.x in 2008, I think this should be reported as a bug.
kind regards,
Miguel Leeuwe
- Wednesday, 31 May 2023 20:58 PM UTC
- PowerBuilder
- # 5
Hi Chris, Miguel,
Thanks for your effort! I played with the scale, no result. I also played with size 30% but that gives strange results. Extra margins and creating a PDF results in very small picture. I will report a bug.
Thanks again!
Regards,
Richard
- Chris Pollach @Appeon
- Thursday, 1 June 2023 00:26 AM UTC
Suggestion: Try adding a Picture Control to the background layer of the DWO and use that to control the image instead.
I'll post an example I just made from your test case.
HTH
-
Helpful Loading... Helpful 1
- Page :
- 1
However, you are not allowed to reply to this question.