Hello again!
In addition to the ticket https://www.scichart.com/questions/question/memory-usage-1
I’ve modified my project to run faster. I’ve put BackgroundImageAnnotation, from which we create sprite, outside the function. But when I run the application, the image freezes and doesn’t redraw.
What is the reason? And how can I fix it?
I’ve attached modified project below.
Link: https://yadi.sk/d/TSsZuDTbipP7y
- Egor asked 9 years ago
- last edited 9 years ago
- You must login to post comments
Hi Egor,
CustomAnnotation is designed to show an annotation with a single X,Y point and requires that you set the Width and Height.
Alternatively, if you want an annotation to cover the whole chart you can use BoxAnnotation and set its Template, as follows:
<s:BoxAnnotation X1="0" X2="1" Y1="0" Y2="1" CoordinateMode="Relative" AnnotationCanvas="BelowChart">
<s:BoxAnnotation.Template>
<ControlTemplate TargetType="s:BoxAnnotation">
<Border x:Name="PART_BoxAnnotationRoot" BorderBrush="Transparent" BorderThickness="0" Background="Transparent">
<!-- Assuming DataContext has ImageSource dependency property -->
<Image Source="{Binding Path=ImageSource,ElementName=BackgroundImage}"/>
</Border>
</ControlTemplate>
</s:BoxAnnotation.Template>
</s:BoxAnnotation>
That will stretch the BoxAnnotation over the entire chart surface, and automatically resize as the chart resizes.
Best regards,
Andrew
- Andrew Burnett-Thompson answered 9 years ago
- You must login to post comments
Please login first to submit.