3 using namespace System;
4 using namespace System::Xml;
5 using namespace System::Text;
6 using namespace System::Drawing;
7 using namespace System::Drawing::Drawing2D;
8 using namespace System::Collections::Generic;
9 using namespace System::ComponentModel;
18 public enum class Type
39 ref class MSTAnnotationPage;
44 [DefaultPropertyAttribute(
"Name")]
58 [CategoryAttribute(
"General"), DescriptionAttribute(
"Type of annotation.")]
59 property Type AnnotationType
66 [CategoryAttribute(
"General"), DescriptionAttribute(
"Border color of annotation. [Format: RGB/ARGB]")]
67 property Color BorderColor
82 [CategoryAttribute(
"General"), DescriptionAttribute(
"Border width of annotation. [Range: 1-10]")]
83 property Int32 BorderWidth
87 return (Int32)m_pen->Width;
100 [BrowsableAttribute(
false)]
101 property bool Selected
103 bool get(){
return m_bSelected;}
104 void set(
bool value){m_bSelected=value;}
110 [BrowsableAttribute(
false)]
111 property array<PointF>^ Points
113 virtual array<PointF>^
get(){
return m_ptArr;}
119 [BrowsableAttribute(
false)]
120 property PointF Points[Int16]
122 virtual PointF
get(Int16 iIndex)
124 if(iIndex < 0 || iIndex >= m_ptArr->Length)
throw gcnew System::ArgumentException(
"Index out of range.");
125 return m_ptArr[iIndex];
127 virtual void set(Int16 iIndex,PointF Value)
129 if(iIndex < 0 || iIndex >= m_ptArr->Length)
throw gcnew System::ArgumentException(
"Index out of range.");
130 m_ptArr[iIndex] = Value;
137 [BrowsableAttribute(
false)]
138 property System::Drawing::Drawing2D::GraphicsPath^ graphicsPath
142 GraphicsPath^ path =
gcnew GraphicsPath();
151 [BrowsableAttribute(
false)]
152 property array<RectangleF>^ PointRect
154 virtual array<RectangleF>^
get()
156 array<PointF>^ pts = Points;
157 array<RectangleF>^ rectArr =
gcnew array<RectangleF>(pts->Length);
158 for(
int i=0;i<pts->Length;i++)
160 rectArr[i] = RectangleF(pts[i].X-4,pts[i].Y-4,8,8);
169 [BrowsableAttribute(
false)]
170 property Int16 PointsCount
172 virtual Int16
get(){
return m_ptArr->Length;}
179 void DrawPoints(Graphics ^g);
185 array<PointF>^ GetNormalPoints();
191 virtual void Save(XmlDocument^ writer,XmlElement^ element);
196 virtual void Load(XmlElement^ element);
206 void FlipGraphicsPath(GraphicsPath^ gp,
float Width,
float Height,
bool bHorz,
bool bVert);
216 System::Drawing::SolidBrush^ brush =
gcnew System::Drawing::SolidBrush(Color::FromArgb(150,0,0,0));
217 StringFormat ^ Centre =
gcnew StringFormat();
218 Centre->Alignment = StringAlignment::Center;
219 Font^ font =
gcnew Font(
"Calibri",12);
220 System::Drawing::Rectangle rect = System::Drawing::Rectangle(location.X,location.Y,g->MeasureString(text,font).Width+5 ,g->MeasureString(text,font).Height);
221 g->FillRectangle(brush,rect);
222 g->DrawString(text, font,Brushes::Wheat,rect,Centre);
227 void DrawScale(GraphicsPath^ g,PointF pt1,PointF pt2,
float distance);
234 virtual void Move(
int cx,
int cy);
241 virtual bool HitTest(PointF pt);
248 virtual bool IntersectsRect(System::Drawing::Rectangle rect);
254 virtual void ApplyMatrix(Matrix^ matrix);
260 virtual Int16 GetPointIndex(PointF pt);
266 virtual void Draw(Graphics^ g,array<PointF>^ ptArr,
bool bShowSelection);
267 virtual void Draw(GraphicsPath^ gp,array<PointF>^ ptArr);
268 void Burn(Graphics^ g);
276 static bool IsLineIntersectsRect(array<PointF>^ pts,System::Drawing::Rectangle rect);
277 static double getdistance(PointF start, PointF end,
float fPixelWidth,
float fPixelHeight);
280 array<PointF>^ m_ptArr;
Definition: AnnotationPage.h:95
void DrawString(Graphics^ g, String^ text, Point location)
Draw String.
Definition: Annotation.h:214
Definition: SinglePointAnnotation.h:37
Definition: Annotation.h:45