Project

General

Profile

Actions

Support #2300

closed

Artefacts in rendering WPaintedWidget

Added by Anonymous over 10 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
High
Assignee:
Target version:
-
Start date:
10/08/2013
Due date:
% Done:

0%

Estimated time:

Description

Hello! I am using WPaintedWidget to draw a map, map picture is generated (no matter how) and saved to png file, so in paint event I'm just painting this image using WPainter::drawImage. On mouse event I send request to generate new map picture and then repaint it in my widget (zoom etc.). When user interacts with map it is a lot of repaints, and widget is blinking, but it's not the most problem. Real problem is artefacts: at some times black rectangle appears and sometimes whole widget are becomes white. These artefacts appears and dissapers periodically while interacting with map. I'm now using HtmlCanvas as rendering method.

Do you have some idea how to get rid of these artefacts? And what is the best rendering method for this kind of task (frequently redraw image from png (or I can save to other format) file?

Actions #1

Updated by Vitaly Volochay over 10 years ago

And when I tried to use PngImage as rendering method WPainter::drawImage failed with error in log:

"[2013-Oct-08 15:56:33.394717] 13859 [/ PTWaf5tIt5QeoLhe] [error] "WRasterImage: drawImage failed: Unable to open file, /PTWaf5tIt5QeoLhe.png\", where PTWaf5tIt5QeoLhe.png - is png-file with map.

Actions #2

Updated by Koen Deforche over 10 years ago

  • Status changed from New to Feedback
  • Assignee set to Koen Deforche

Hey,

The only motivation to need a painter to draw images is if you want to transform them in some way (e.g. rotation). Otherwise you're better off with using plain WImage or CSS background images? The artefacts you see are likely browser issues, unless you suspect not in which case a test case would be appreciated.

koen

Actions #3

Updated by Vitaly Volochay over 10 years ago

I need to draw some object over the map (picture) so I think I can't use WImage, is there a good way to set background image for my WPaintedWidget like this:

decorationStyle().setBackgroundImage("map.png");

and draw other objects with WPainter?

I tried InlineSvgVml as rendering method and artefacts seems to dissapear but image blinking even more.

And what about PngImage? (comment #1)

Actions #4

Updated by Wim Dumon over 10 years ago

The issue with pngimage is probably a wrong path? The path seems to be absolute and points to the root of your file system.

You can put a WPaintedWidget on top of a WImage. Use absolute positioning.

BR,

Wim.

Actions #5

Updated by Vitaly Volochay over 10 years ago

Tried:

decorationStyle().setBackgroundImage("map.png");

But had the same problem, artefacts and blinking..

Actions #6

Updated by Wim Dumon over 10 years ago

Please provide an example that demonstrates the issue.

Wim.

Actions #7

Updated by Koen Deforche about 9 years ago

  • Tracker changed from Bug to Support
  • Status changed from Feedback to Closed
Actions

Also available in: Atom PDF