|
Drop Shadow Question |
Posted by adrian4891 on Feb-08-2011 01:45 |
|
Hi I have a quick question for you,
I noticed that when I use setDropShadow() it adds an extra 10 pixels to the height and width of my image. For example, if you see this image http://www.advsofteng.com/images/legendpie2_p.png you will see the size of the image is 610px ? 330px. But Imagine the real size is 600px ? 320px and the extra 10px was added by setDropShadow().
My questions is, is the extra 10px added by setDropShadow() constant? Can I just put in my code : if DropShadow is true reduce width and height by 10px? |
Re: Drop Shadow Question |
Posted by Peter Kwan on Feb-09-2011 03:24 |
|
Hi adrian4891,
In ChartDirector, if the chart is created as 600 x 300 pixels, it means the "chart frame" is 600 x 300 pixels. It does not include the drop shadow exterior to the "chart frame". This is consistent with what do width and height mean on Windows. For example, if you are using Windows Vista of Windows 7, you may notice there is a drop shadow outside the browser frame. If you query Windows for the size of the browser, it will report the width and height exclusive of the drop shadow.
When the chart with the drop shadow is saved as an image, the image necessarily will need to be bigger to include the drop shadow. The size increase depends on the drop shadow offset and blur radius, which is configurable when you called setDropShadow. The default is 5 pixels offset to the right and to the bottom, with a blur radius of 5 pixels. This result in 10 additional pixels to the right and to the bottom. You may refer to BaseChart.setDropShadow for more information.
If you want the size to be w and h inclusive of the drop shadow, you would need to set the size to w - 10 or h - 10 when creating the chart (assuming you have enabled drop shadow using the default offset and blur radius).
Hope this can help.
Regards
Peter Kwan |
Re: Drop Shadow Question |
Posted by adrian4891 on Feb-09-2011 09:17 |
|
Perfect. Thanks for your help. |
|