1) In the IDE I can set the "hatch" (pattern) for a TColorBandTool. The DFM looks like this:
object ChartTool1: TColorBandTool
Brush.Image.Data = {
07544269746D61707E000000424D7E000000000000003E000000280000001000
0000100000000100010000000000400000000000000000000000020000000000
000000000000FFFFFF00FFFF0000FFFF0000FFFF000077770000FFFF0000FFFF
0000FFFF000077770000FFFF0000FFFF0000FFFF000077770000FFFF0000FFFF
0000FFFF000077770000}
...
I would like to use that same pattern when I add tools at runtime (named "FIll 20%").
Is that possible?
2) When setting the Hatch in the IDE, the "Transparent" check box is disabled (and checked) but there is ability to configure the level of transparency. How can I do that?
Thank you,
Ed Dressel
Setting Pattern for TColor
-
- Newbie
- Posts: 16
- Joined: Mon Dec 05, 2016 12:00 am
Re: Setting Pattern for TColor
I tried to create my own PNG file and load it in to the IDE but it did not tile it, rather it stretched the 20x20 for the whole band (which didn't look so great).
I look forward to hearing back from you.
I look forward to hearing back from you.
Re: Setting Pattern for TColor
Hello,
There's no Transparency (percentage) property associated.
Yes, you can do it as follows:Test Always wrote:1) In the IDE I can set the "hatch" (pattern) for a TColorBandTool. The DFM looks like this:
[...]
I would like to use that same pattern when I add tools at runtime (named "FIll 20%").
Is that possible?
Code: Select all
var tmpBitmap: TBitmap;
//...
with Chart1.Tools.Add(TColorBandTool) as TColorBandTool do
begin
Axis:=Chart1.Axes.Bottom;
StartValue:=10;
EndValue:=14;
tmpBitmap:=TBitmap.Create;
try
GetTeeBrush(4,tmpBitmap); //0 is "Diagonal Cross", 1 is "Fill 80%", 2 is "Fill 60%",...
Brush.Image.Graphic:=tmpBitmap;
finally
tmpBitmap.Free;
end;
end;
The "Transparent" checkbox basically sets the Brush BackColor to clNone. It's only enabled when you set a BackColor ("Back..." button in the editor).Test Always wrote:2) When setting the Hatch in the IDE, the "Transparent" check box is disabled (and checked) but there is ability to configure the level of transparency. How can I do that?
There's no Transparency (percentage) property associated.
This seems to work fine for me here:Test Always wrote:I tried to create my own PNG file and load it in to the IDE but it did not tile it, rather it stretched the 20x20 for the whole band (which didn't look so great).
Code: Select all
with Chart1.Tools.Add(TColorBandTool) as TColorBandTool do
begin
Axis:=Chart1.Axes.Bottom;
StartValue:=18;
EndValue:=22;
Brush.Image.LoadFromFile('C:\tmp\20x20pattern.png');
if not (Brush.Image.Graphic is TBitmap) then
begin
tmpBitmap:=TBitmap.Create;
TeeSetBitmapSize(tmpBitmap,Brush.Image.Width,Brush.Image.Height);
tmpBitmap.Canvas.Draw(0,0,Brush.Image.Graphic);
Brush.Image.Bitmap:=tmpBitmap;
end;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Setting Pattern for TColor
Is this a difference in rendering between TTeeCanvas3D and TGDIPlusCanvas?
In GDI mode it stretches the image, in GDI+ mode it tiles. This appears to be a change in TeeChart since 2012, when GDI mode also tiled.
The difference can be seen by running the current demo program Tee9New_win64Delphi25.exe, navigating to All Features | Welcome ! | Tools | Color Band | Transparency [which sets Brush.Image.Data] and toggling the GDI+ checkbox.
In GDI mode it stretches the image, in GDI+ mode it tiles. This appears to be a change in TeeChart since 2012, when GDI mode also tiled.
The difference can be seen by running the current demo program Tee9New_win64Delphi25.exe, navigating to All Features | Welcome ! | Tools | Color Band | Transparency [which sets Brush.Image.Data] and toggling the GDI+ checkbox.
Re: Setting Pattern for TColor
Hello,
However, I'm not sure it's worth fixing it in GDI since we always recommend using GDIPlus and we don't have plans to continue improving GDI.
Indeed the images are stretched in GDI and not in GDIPlus. And I see the change was introduced in v2013.08.IanY wrote:Is this a difference in rendering between TTeeCanvas3D and TGDIPlusCanvas?
In GDI mode it stretches the image, in GDI+ mode it tiles. This appears to be a change in TeeChart since 2012, when GDI mode also tiled.
The difference can be seen by running the current demo program Tee9New_win64Delphi25.exe, navigating to All Features | Welcome ! | Tools | Color Band | Transparency [which sets Brush.Image.Data] and toggling the GDI+ checkbox.
However, I'm not sure it's worth fixing it in GDI since we always recommend using GDIPlus and we don't have plans to continue improving GDI.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |