Pen


public ref class Pen
{
 Handle penHandle;

 public:

 Pen(Brush^ brush)
 {
     penHandle = GdiPlus::CreatePen(brush,
                                     1.0,
                                     (unsigned)IPlusPlus::Drawing::Unit::Pixel);
 }

 Pen(Brush^ brush,
     double width)
 {
     penHandle = GdiPlus::CreatePen(brush,
                                     width,
                                     (unsigned)IPlusPlus::Drawing::Unit::Pixel);
 }

Pen(Brush^ brush,
    double width,
    IPlusPlus::Drawing::Unit unit)
 {
     penHandle = GdiPlus::CreatePen(brush,
                                     width,
                                     (unsigned)unit);
 }

 Pen(Color color)
 {
     penHandle = GdiPlus::CreatePen((unsigned)color,
                                     1.0,
                                     (unsigned)IPlusPlus::Drawing::Unit::Pixel);
 }

 Pen(Color color,
     double width)
 {
     penHandle = GdiPlus::CreatePen((unsigned)color,
                                     width,
                                     (unsigned)IPlusPlus::Drawing::Unit::Pixel);
 }

 Pen(Color color,
     double width,
     IPlusPlus::Drawing::Unit unit)
 {
     penHandle = GdiPlus::CreatePen((unsigned)color,
                                     width,
                                     (unsigned)unit);
 }

 static operator Handle(Pen^ penToConvert) {return penToConvert->penHandle;}

 Pen(Pen^ penCopy) {penHandle = GdiPlus::ClonePen(penCopy);}

 ~Pen() {GdiPlus::DeletePen(penHandle);}

 property double Width
 {
     double get() {return GdiPlus::GetPenWidth(penHandle);}
     void set(double value) {GdiPlus::SetPenWidth(penHandle,value);}
 }

 property IPlusPlus::Drawing::Unit Unit
 {
     IPlusPlus::Drawing::Unit get() {return (IPlusPlus::Drawing::Unit)GdiPlus::GetPenUnit(penHandle);}
     void set(IPlusPlus::Drawing::Unit value) {GdiPlus::SetPenUnit(penHandle,(unsigned)value);}
 }

 property unsigned StartCap
 {
     unsigned get() {return GdiPlus::GetPenStartCap(penHandle);}
     void set(unsigned value) {GdiPlus::SetPenStartCap(penHandle,value);}
 }

 property unsigned EndCap
 {
     unsigned get() {return GdiPlus::GetPenEndCap(penHandle);}
     void set(unsigned value) {GdiPlus::SetPenEndCap(penHandle,value);}
 }

 property unsigned DashCap
 {
     unsigned get() {return GdiPlus::GetPenDashCap(penHandle);}
     void set(unsigned value) {GdiPlus::SetPenDashCap(penHandle,value);}
 }

 property unsigned LineJoin
 {
     unsigned get() {return GdiPlus::GetPenLineJoin(penHandle);}
     void set(unsigned value) {GdiPlus::SetPenLineJoin(penHandle,value);}
 }

 property CustomLineCap^ CustomStartCap
 {
     CustomLineCap^ get() {return gcnew CustomLineCap(GdiPlus::GetPenCustomStartCap(penHandle));}
     void set(CustomLineCap^ value) {GdiPlus::SetPenCustomStartCap(penHandle,value);}
 }

 property CustomLineCap^ CustomEndCap
 {
     CustomLineCap^ get() {return gcnew CustomLineCap(GdiPlus::GetPenCustomEndCap(penHandle));}
     void set(CustomLineCap^ value) {GdiPlus::SetPenCustomEndCap(penHandle,value);}
 }

 property double MitreLimit
 {
     double get() {return GdiPlus::GetPenMitreLimit(penHandle);}
     void set(double value) {GdiPlus::SetPenMitreLimit(penHandle,value);}
 }

 property unsigned Mode
 {
     unsigned get() {return GdiPlus::GetPenMode(penHandle);}
     void set(unsigned value) {GdiPlus::SetPenMode(penHandle,value);}
 }

 property Matrix^ Transform
 {
     Matrix^ get() {return gcnew Matrix(GdiPlus::GetPenTransform(penHandle));}
     void set(Matrix^ value) {GdiPlus::SetPenTransform(penHandle,value);}
 }

 void ResetTransform()
 {
	 GdiPlus::ResetPenTransform(penHandle);
 }

 void MultiplyTransform(Matrix^ transform,
	                    MatrixOrder order)
 {
	 GdiPlus::MultiplyPenTransform(penHandle,transform,order);
 }

void TranslateTransform(double x,
						double y,
	                    MatrixOrder order)
 {
	 GdiPlus::TranslatePenTransform(penHandle,x,y,order);
 }

void ScaleTransform(double x,
					double y,
	                MatrixOrder order)
 {
	 GdiPlus::ScalePenTransform(penHandle,x,y,order);
 }

void RotateTransform(double angle,
 	                 MatrixOrder order)
 {
	 GdiPlus::RotatePenTransform(penHandle,angle,order);
 }

 property IPlusPlus::Drawing::Color Color
 {
     IPlusPlus::Drawing::Color get() {return IPlusPlus::Drawing::Color(GdiPlus::GetPenColor(penHandle));}
     void set(IPlusPlus::Drawing::Color value) {GdiPlus::SetPenColor(penHandle,value);}
 }

 property Brush^ BrushFill
 {
     Brush^ get() {return gcnew Brush(GdiPlus::GetPenBrushFill(penHandle));}
     void set(Brush^ value) {GdiPlus::SetPenBrushFill(penHandle,value);}
 }

 property int FillType
 {
     int get() {return GdiPlus::GetPenFillType(penHandle);}
 }

 property unsigned DashStyle
 {
     unsigned get() {return GdiPlus::GetPenDashStyle(penHandle);}
     void set(unsigned value) {GdiPlus::SetPenDashStyle(penHandle,value);}
 }

 property double DashOffset
 {
     double get() {return GdiPlus::GetPenDashOffset(penHandle);}
     void set(double value) {GdiPlus::SetPenDashOffset(penHandle,value);}
 }

 property int DashCount
 {
     int get() {return GdiPlus::GetPenDashCount(penHandle);}
 }

 property Array<double>^ DashArray
 {
     Array<double>^ get() {return GdiPlus::GetPenDashArray(penHandle);}
     void set(Array<double>^ value) {GdiPlus::SetPenDashArray(penHandle,value);}
 }

 property int CompoundCount
 {
     int get() {return GdiPlus::GetPenCompoundCount(penHandle);}
 }

 property Array<double>^ CompoundArray
 {
     Array<double>^ get() {return GdiPlus::GetPenCompoundArray(penHandle);}
     void set(Array<double>^ value) {GdiPlus::SetPenCompoundArray(penHandle,value);}
 }

};

Details

Name Space IPlusPlus::Drawing
Assembly IPlusPlus.Drawing.dll