protected void Initialize(PlainImage pi, bool addToCollection)
        {
            if (!addToCollection)
            {
                NativeObject.Clear();
            }

            NativeObject.Add(pi);
        }
        private void SetPath(Point [] pts, byte [] types)
        {
            NativeObject.Clear();
            if (((PathPointType)types [0] & PathPointType.PathTypeMask) != PathPointType.Start)
            {
                NativeObject.moveTo(pts [0].X, pts [0].Y);
            }

            for (int i = 0; i < pts.Length; i++)
            {
                switch (((PathPointType)types [i] & PathPointType.PathTypeMask))
                {
                case PathPointType.Start:
                    NativeObject.moveTo(pts [i].X, pts [i].Y);
                    break;

                case PathPointType.Line:
                    NativeObject.lineTo(pts [i].X, pts [i].Y);
                    break;

                case PathPointType.Bezier3:
                    float x1 = pts [i].X;
                    float y1 = pts [i].Y;
                    i++;
                    float x2 = pts [i].X;
                    float y2 = pts [i].Y;
                    i++;
                    float x3 = pts [i].X;
                    float y3 = pts [i].Y;
                    NativeObject.curveTo(x1, y1, x2, y2, x3, y3);
                    break;
                }
                if (((PathPointType)types [i] & PathPointType.CloseSubpath) != 0)
                {
                    NativeObject.closePath();
                }

                if (((PathPointType)types [i] & PathPointType.PathMarker) != 0)
                {
                    NativeObject.SetMarkers();
                }
            }
        }