Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 71 - BackImage & pbmStretch causes wrong rendering
Summary: BackImage & pbmStretch causes wrong rendering
Status: RESOLVED FIXED
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: Canvas (show other bugs)
Version: 131016
Hardware: PC Windows
: --- enhancement
Target Milestone: ---
Assignee: Steema Issue Manager
URL: http://www.codeproject.com/Articles/1...
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-05 09:43 EST by narcís calvet
Modified: 2013-11-05 12:38 EST (History)
1 user (show)

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments
test project (2.66 KB, application/octet-stream)
2013-11-05 09:43 EST, narcís calvet
Details
Modified test project showing differences between GDI and GDI+ (8.11 KB, application/x-zip-compressed)
2013-11-05 10:58 EST, david berneda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description narcís calvet 2013-11-05 09:43:47 EST
Created attachment 12 [details]
test project

If you add a BackImage and set BackImageMode to pbmStretch, there are painting issues along the left and right borders of the chart. The painting artifacts are not visible when the BackImageMode is set to pbmTile. The problem gets worse when rendering is changed from GDI+ to GDI. Note that the issue is visible during design-time and run-time. Find attached project reproducing this.
Comment 1 david berneda 2013-11-05 10:54:25 EST
GDI+ :

This is due to the named "BorderBug" of GDI+:
http://www.codeproject.com/Articles/14884/BorderBug

One solution for "flat" (no detail) images that are enlarged, is to use "low" stretch quality.  

Chart1.Canvas.StretchDrawQuality:=sqLow;

but, this property is at canvas level, and not at Chart BackImage level.
I'll implement this as an option at BackImage level so it'll be available for any chart element shape back picture, ie:

Chart1.BackImage.DrawQuality := sqLow;

---------------------------------------------


GDI :

With GDI, TeeChart does its own stretch algorithm instead of using GDI StretchBlt, to obtain a better smooth quality.
This works fine when both reducing or enlarging an image, but emits noise when on content areas that are "flat" (no detail, such as single color backgrounds).

The above DrawQuality property will also be handy with GDI, to use the default GDI stretch instead of the internal one.
Comment 2 david berneda 2013-11-05 10:58:40 EST
Created attachment 14 [details]
Modified test project showing differences between GDI and GDI+
Comment 3 david berneda 2013-11-05 12:38:44 EST
Fixed with TBackImage.DrawQuality new property. 
Default is "sqHigh".