09-09-2008 05:28 AM
There are several shapes that can be chosen when I add an annotation, but can I add a self-defined image from a file or resources?
(I'm using C#)
09-12-2008 02:43 AM
09-12-2008 03:36 AM
Thank you for your answer, I would like to use an image as the annotation. As far as I can see, the shapestyle must return PointF[] from GetPoints(PointF shapePoint, Size shapeSize).
Is there any way I can convert my Image to be returned and used as the annotation?
-Per Helge
09-12-2008 06:12 AM
There is no direct way of converting an image to an annotation. But it is possible to display an image as an annotation.
Using ShapeStyle, you can only customize the shape of a XYPointAnnotation. To display an image you can use ShapeFillStyle property on Annotation to fill from Image.
xyPointAnnotation1.ShapeFillStyle = FillStyle.FromImage(image, ImageAlignment.Stretch);
As a simple alternative, you can use a XYRangeAnnotation which is rectangular in shape and use the RangeFillStyle property of it to display an image.
xyRangeAnnotation1.RangeFillStyle = FillStyle.FromImage(image, ImageAlignment.Stretch);
Let me know if this works for you.
09-12-2008 07:32 AM
Thank you, I used the XYPointAnnotation shaped as a square. It worked great.
-per helge