Example #1
0
        private void axMapControl1_OnMouseDown(object sender, IMapControlEvents2_OnMouseDownEvent e)
        {
            if (miStartEditing.Enabled == false) //Start Editing
            {
                DataOperator  dataOperator = new DataOperator(axMapControl1.Map);
                ILayer        layer        = dataOperator.GetLayerByName(sEditLayerName); // Get the layer to edit
                IFeatureLayer featureLayer = layer as IFeatureLayer;
                IFeature      feature;

                if (featureLayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPoint) //Edit point
                {
                    IPoint point = new PointClass();
                    point.PutCoords(e.mapX, e.mapY);
                    feature = dataOperator.AddGeometryToLayer(sEditLayerName, point);
                    AddFeature addFeatureName = new AddFeature(feature, axMapControl1.Map, this);
                    addFeatureName.ShowDialog();
                }
                else if (featureLayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPolygon)
                {
                    if (drawPolygon == null)//Continue creating polygons when editting is not stopped
                    {
                        drawPolygon = new DrawPolygon(sEditLayerName, axMapControl1.Map, this);
                        drawPolygon.set_drawStart(true);
                        IPoint point = new PointClass();
                        point.PutCoords(e.mapX, e.mapY);
                        drawPolygon.set_startPoint(point);   //set start point
                        drawPolygon.OnCreate(axMapControl1.Object);
                        drawPolygon.set_polyFeedback(point);
                    }
                }
                return;
            }
        }
Example #2
0
 public override void OnMouseDown(DrawArea drawArea, MouseEventArgs e)
 {
     newPolygon = new DrawPolygon(e.X, e.Y, e.X + 1, e.Y + 1);
     AddNewObject(drawArea, newPolygon);
     lastX = e.X;
     lastY = e.Y;
 }
        /// <summary>
        /// Reduce the number of points in a polygon.
        /// </summary>
        /// <param name="Points">The points.</param>
        /// <param name="Tolerance">The tolerance.</param>
        /// <returns></returns>
        public static DrawPolygon ReductionPolygon(List <PointF> Points, Double Tolerance)
        {
            Int32        firstPoint        = 0;
            Int32        lastPoint         = Points.Count - 1;
            List <Int32> pointIndexsToKeep = new List <Int32>();

            //Add the first and last index to the keepers
            pointIndexsToKeep.Add(firstPoint);
            pointIndexsToKeep.Add(lastPoint);

            //The first and the last PointF can not be the same
            while (Points[firstPoint].Equals(Points[lastPoint]))
            {
                lastPoint--;
            }

            Reduction(Points, firstPoint, lastPoint, Tolerance, ref pointIndexsToKeep);

            DrawPolygon returnPolygon = new DrawPolygon();
            Point       point;

            pointIndexsToKeep.Sort();
            foreach (Int32 index in pointIndexsToKeep)
            {
                point   = new Point();
                point.X = (int)Points[index].X;
                point.Y = (int)Points[index].Y;
                returnPolygon.AddPoint(point);
            }

            return(returnPolygon);
        }
Example #4
0
 /// <summary>
 /// Left nouse button is pressed
 /// </summary>
 /// <param name="drawArea"></param>
 /// <param name="e"></param>
 public override void OnMouseDown(DrawArea drawArea, MouseEventArgs e)
 {
     // Create new polygon, add it to the list
     // and keep reference to it
     newPolygon = new DrawPolygon(e.X, e.Y, e.X + 1, e.Y + 1);
     AddNewObject(drawArea, newPolygon);
     lastX = e.X;
     lastY = e.Y;
 }
Example #5
0
 private void stopEditingToolStripMenuItem_Click(object sender, EventArgs e)
 {
     miStopEditing.Enabled  = false;
     miStartEditing.Enabled = true;
     if (drawPolygon != null)
     {
         drawPolygon.set_drawStart(false);//Stop creating polygons
         drawPolygon = null;
     }
 }
Example #6
0
        public IDrawObj CreateDrawObj(DrawType type)
        {
            //todo add control
            IDrawObj obj;

            switch (type)
            {
            case DrawType.Group:
                obj = new DrawGroup();
                break;

            case DrawType.Combine:
                obj = new DrawCombine();
                break;

            case DrawType.Rect:
                obj = new DrawRect();
                break;

            case DrawType.Ellipse:
                obj = new DrawEllipse();
                break;

            case DrawType.Text:
                obj = new DrawText();
                break;

            case DrawType.StraightLine:
                obj = new DrawStraightLine();
                break;

            case DrawType.FoldLine:
                obj = new DrawFoldLine();
                break;

            case DrawType.Bezier:
                obj = new DrawBezier();
                break;

            case DrawType.Polygon:
                obj = new DrawPolygon();
                break;

            case DrawType.ClosedBezier:
                obj = new DrawClosedBezier();
                break;

            default:
                return(null);
            }

            return(obj);
        }
Example #7
0
    public void Spawn(int verticeCount)
    {
        // Handle spawning instances
        //if (lastInstance != null) Destroy(lastInstance);
        var instance = Instantiate(shapePrefab, Vector3.zero, Quaternion.identity);

        // Get the polygon and update vertex count
        Polygon polygon = instance.GetComponent <Polygon>();

        polygon.count = verticeCount;

        // Get the component to draw and update the color
        DrawPolygon draw = instance.GetComponent <DrawPolygon>();

        draw.polygonColor = colorManager.polygonColor;

        // Add to list
        shapes.Add(instance);
    }
Example #8
0
    public void Spawn(int verticeCount, float stiffness, float damping, float centerStiffness, float centerDamping)
    {
        // Handle spawning instances
        //if (lastInstance != null) Destroy(lastInstance);
        var instance = Instantiate(shapePrefab, Vector3.zero, Quaternion.identity);

        // Get the polygon and update variables
        Polygon polygon = instance.GetComponent <Polygon>();

        polygon.count           = verticeCount;
        polygon.stiffness       = stiffness;
        polygon.damping         = damping;
        polygon.centerStiffness = centerStiffness;
        polygon.centerDamping   = centerDamping;

        // Get the component to draw and update the color
        DrawPolygon draw = instance.GetComponent <DrawPolygon>();

        draw.polygonColor = colorManager.polygonColor;

        // Add to list
        shapes.Add(instance);
    }
Example #9
0
        public override void OnMouseUp(DrawArea drawArea, MouseEventArgs e)
        {
            newPolygon = null;

            base.OnMouseUp(drawArea, e);
        }
 private void buttonOK_Click(object sender, EventArgs e)
 {
     if (_currentMap != null)
     {
         List <HtmlElement_area> areas = new List <HtmlElement_area>();
         List <DrawingItem>      lst   = mapCtrl.ExportDrawingItems();
         if (lst != null && lst.Count > 0)
         {
             foreach (DrawingItem di in lst)
             {
                 HtmlElement_area ha   = null;
                 ClassPointer     root = _webpage.GetDevClass() as ClassPointer;
                 DrawCircle       dc   = di as DrawCircle;
                 if (dc != null)
                 {
                     ha           = new HtmlElement_area(root);
                     ha.shape     = EnumAreaShape.circle;
                     ha.coords    = new int[3];
                     ha.coords[0] = dc.CircleCenter.X;
                     ha.coords[1] = dc.CircleCenter.Y;
                     ha.coords[2] = dc.Radius;
                 }
                 else
                 {
                     DrawRect dr = di as DrawRect;
                     if (dr != null)
                     {
                         ha           = new HtmlElement_area(root);
                         ha.shape     = EnumAreaShape.rect;
                         ha.coords    = new int[4];
                         ha.coords[0] = dr.Rectangle.X;
                         ha.coords[1] = dr.Rectangle.Y;
                         ha.coords[2] = dr.Rectangle.X + dr.Rectangle.Width;
                         ha.coords[3] = dr.Rectangle.Y + dr.Rectangle.Height;
                     }
                     else
                     {
                         DrawPolygon dp = di as DrawPolygon;
                         if (dp != null)
                         {
                             ha        = new HtmlElement_area(root);
                             ha.shape  = EnumAreaShape.poly;
                             ha.coords = new int[dp.PointCount * 2];
                             for (int k = 0; k < dp.PointCount; k++)
                             {
                                 ha.coords[2 * k]     = dp.PointList[k].X;
                                 ha.coords[2 * k + 1] = dp.PointList[k].Y;
                             }
                         }
                     }
                 }
                 if (ha != null)
                 {
                     ha.SetGuid(di.DrawingId);
                     ha.SetId(di.Name);
                     areas.Add(ha);
                 }
             }
         }
         _currentMap.SetAreas(areas);
         _webpage.UpdateMapAreas(_currentMap);
         MapID             = _currentMap.id;
         this.DialogResult = DialogResult.OK;
     }
 }
        /// <summary>
        /// Change mokkan extraction parameters
        /// </summary>
        private void ChangeExtraction()
        {
            if (_init)
            {
                return;
            }

            this.Cursor = Cursors.WaitCursor;

            List <Boundary> bounds = MokkanExtraction.BoundaryTracking(_binBmp, _bndRec);

            // get top regions
            List <int> tops = new List <int>();

            GetTopAreas(bounds, _mokkanNum, tops);

            // number of regions
            int n = Math.Min(_mokkanNum, tops.Count - 1);

            DrawPolygon reducePolygon;

            MkaMokkanInfo.LastRBangou -= _list.Count;
            _list.Clear();
            Bitmap   ret = (Bitmap)_oriBmp.Clone();
            Graphics g   = Graphics.FromImage(ret);

            g.DrawRectangle(Pens.Red, _bndRec);

            for (int i = 0; i < n; i++)
            {
                if (_tolerance == 0)
                {
                    reducePolygon = new DrawPolygon();
                    foreach (PointF p in bounds[tops[i]].Points)
                    {
                        reducePolygon.AddPoint(new Point((int)p.X, (int)p.Y));
                    }
                }
                else
                {
                    // get reduce polygon
                    reducePolygon = PolygonApproximation.ReductionPolygon(bounds[tops[i]].Points, _tolerance);
                }

                _list.Add(reducePolygon);
                MkaMokkanInfo.LastRBangou++;

                g.DrawPolygon(_pen, bounds[tops[i]].Points.ToArray());
                g.FillPolygon(_brush, bounds[tops[i]].Points.ToArray());
            }

            g.Dispose();
            bounds.Clear();
            tops.Clear();

            if (picImageView.Image != null)
            {
                picImageView.Image.Dispose();
            }
            picImageView.Image = ret;

            this.Cursor = Cursors.Default;
        }
        public IList <DrawingItem> ExportShapes()
        {
            List <DrawingItem> items = new List <DrawingItem>();

            if (_areas != null)
            {
                foreach (HtmlElement_area hb in _areas)
                {
                    DrawingItem di = null;
                    switch (hb.shape)
                    {
                    case EnumAreaShape.circle:
                        DrawCircle dc = new DrawCircle();
                        if (hb.coords != null && hb.coords.Length > 1)
                        {
                            dc.CircleCenter = new System.Drawing.Point(hb.coords[0], hb.coords[1]);
                            if (hb.coords.Length > 2)
                            {
                                dc.Radius = hb.coords[2];
                            }
                            else
                            {
                                dc.Radius = 20;
                            }
                        }
                        else
                        {
                            dc.CircleCenter = new System.Drawing.Point(60, 60);
                            dc.Radius       = 20;
                        }
                        di = dc;
                        break;

                    case EnumAreaShape.poly:
                        if (hb.coords != null && hb.coords.Length > 1)
                        {
                            List <CPoint> lst = new List <CPoint>();
                            int           i   = 0;
                            while (i < hb.coords.Length - 1)
                            {
                                lst.Add(new CPoint(new Point(hb.coords[i], hb.coords[i + 1])));
                                i += 2;
                            }
                            if (lst.Count > 3)
                            {
                                DrawPolygon dp = new DrawPolygon();
                                dp.Points = lst;
                                di        = dp;
                            }
                        }
                        break;

                    case EnumAreaShape.rect:
                    default:
                        if (hb.coords != null && hb.coords.Length > 3)
                        {
                            if (hb.coords[2] > hb.coords[0] && hb.coords[3] > hb.coords[1])
                            {
                                Rectangle rc = new Rectangle(hb.coords[0], hb.coords[1], hb.coords[2] - hb.coords[0], hb.coords[3] - hb.coords[1]);
                                DrawRect  dr = new DrawRect();
                                dr.Rectangle = rc;
                                di           = dr;
                            }
                        }
                        break;
                    }
                    di.SetGuid(hb.ElementGuid);
                    di.Name = hb.id;
                    items.Add(di);
                }
            }
            return(items);
        }
        public void LoadDisplay(TabGraphicPageControl tabdisplaypagecontrol)
        {
            //GraphicsList graphicslist = new Draw.GraphicsList();
            Pages = new PageList(tabdisplaypagecontrol);


            foreach (tblBitmap tblbitmap in m_tblBitmapCollection)
            {
                DrawImage obj = new DrawImage(Pages);
                obj.Load(tblbitmap);
                Pages.GraphicPagesList[Pages.ActivePageNo].Add(obj);
            }
            foreach (tblADText tbladtext in m_tblADTextCollection)
            {
                DrawText obj = new DrawText(Pages);
                obj.Load(tbladtext);
                Pages.GraphicPagesList[Pages.ActivePageNo].Add(obj);
            }
            foreach (tblLine tblline in m_tblLineCollection)
            {
                DrawLine obj = new DrawLine(Pages);
                obj.Load(tblline);
                Pages.GraphicPagesList[Pages.ActivePageNo].Add(obj);
            }
            foreach (tblRect tblrect in m_tblRectCollection)
            {
                switch ((STATIC_OBJ_TYPE)tblrect.Type)
                {
                case STATIC_OBJ_TYPE.ID_ELLIPS:
                    DrawEllipse drawellipse = new DrawEllipse(Pages);
                    drawellipse.Load(tblrect);
                    Pages.GraphicPagesList[Pages.ActivePageNo].Add(drawellipse);
                    break;

                case STATIC_OBJ_TYPE.ID_ROUNDRECT:
                case STATIC_OBJ_TYPE.ID_RECT:
                    DrawRectangle drawrectangle = new DrawRectangle(Pages);
                    drawrectangle.Load(tblrect);
                    Pages.GraphicPagesList[Pages.ActivePageNo].Add(drawrectangle);
                    break;
                }
            }
            foreach (tblPolyline tblpolyline in m_tblPolylineCollection)
            {
                DrawPolyLine drawpolyline = new DrawPolyLine(Pages);
                drawpolyline.Load(tblpolyline);
                Pages.GraphicPagesList[Pages.ActivePageNo].Add(drawpolyline);
            }
            foreach (tblPolygon tblpolygon in m_tblPolygonCollection)
            {
                DrawPolygon drawpolygon = new DrawPolygon(Pages);
                drawpolygon.Load(tblpolygon);
                Pages.GraphicPagesList[Pages.ActivePageNo].Add(drawpolygon);
            }
            foreach (tblCurve tblcurve in m_tblCurveCollection)
            {
                DrawCurve drawcurve = new DrawCurve(Pages);
                drawcurve.Load(tblcurve);
                Pages.GraphicPagesList[Pages.ActivePageNo].Add(drawcurve);
            }
            Pages.GraphicPagesList[Pages.ActivePageNo].SortoIndex();
        }
Example #14
0
        public void GetImageProcess()//显示图片时读取
        {
            XmlNode node = xmlDoc.SelectSingleNode("PatientBackImage/Image[@Name='" + ImageName + "'] ");

            if (node != null)
            {
                if (node.HasChildNodes)
                {
                    XmlNodeList xmlNolist = node.ChildNodes;
                    foreach (XmlNode xn in xmlNolist)
                    {
                        XmlElement xmlE = (XmlElement)xn;
                        switch (xmlE.Name)
                        {
                        case "DrawLine":
                            DrawLine dl = new DrawLine(Convert.ToInt32(xmlE.GetAttribute("StartPointX")), Convert.ToInt32(xmlE.GetAttribute("StartPointY")), Convert.ToInt32(xmlE.GetAttribute("EndPointX")), Convert.ToInt32(xmlE.GetAttribute("EndPointY")));
                            dl.ID = Convert.ToInt32(xmlE.GetAttribute("ID"));
                            frmImgProcess.imgProcess.drawArea.GraphicsList.UnselectAll();
                            frmImgProcess.imgProcess.drawArea.GraphicsList.Add(dl);
                            frmImgProcess.imgProcess.drawArea.Capture = true;
                            frmImgProcess.imgProcess.drawArea.Refresh();
                            break;

                        case "DrawRectangle":
                            DrawRectangle dr = new DrawRectangle(Convert.ToInt32(xmlE.GetAttribute("X")), Convert.ToInt32(xmlE.GetAttribute("Y")), Convert.ToInt32(xmlE.GetAttribute("Width")), Convert.ToInt32(xmlE.GetAttribute("Height")));
                            dr.ID = Convert.ToInt32(xmlE.GetAttribute("ID"));
                            frmImgProcess.imgProcess.drawArea.GraphicsList.UnselectAll();
                            frmImgProcess.imgProcess.drawArea.GraphicsList.Add(dr);
                            frmImgProcess.imgProcess.drawArea.Capture = true;
                            frmImgProcess.imgProcess.drawArea.Refresh();
                            break;

                        case "DrawEllipse":
                            DrawEllipse de = new DrawEllipse(Convert.ToInt32(xmlE.GetAttribute("X")), Convert.ToInt32(xmlE.GetAttribute("Y")), Convert.ToInt32(xmlE.GetAttribute("Width")), Convert.ToInt32(xmlE.GetAttribute("Height")));
                            de.ID = Convert.ToInt32(xmlE.GetAttribute("ID"));
                            frmImgProcess.imgProcess.drawArea.GraphicsList.UnselectAll();
                            frmImgProcess.imgProcess.drawArea.GraphicsList.Add(de);
                            frmImgProcess.imgProcess.drawArea.Capture = true;
                            frmImgProcess.imgProcess.drawArea.Refresh();
                            break;

                        case "DrawPoint":
                            DrawPoint dp = new DrawPoint(Convert.ToInt32(xmlE.GetAttribute("X")), Convert.ToInt32(xmlE.GetAttribute("Y")));
                            dp.ID = Convert.ToInt32(xmlE.GetAttribute("ID"));
                            frmImgProcess.imgProcess.drawArea.GraphicsList.UnselectAll();
                            frmImgProcess.imgProcess.drawArea.GraphicsList.Add(dp);
                            frmImgProcess.imgProcess.drawArea.Capture = true;
                            frmImgProcess.imgProcess.drawArea.Refresh();
                            break;

                        case "DrawPolygon":
                            DrawPolygon dpy      = new DrawPolygon();
                            string      pointStr = xmlE.GetAttribute("pointStr");
                            string[]    poList   = pointStr.Split('$');
                            string[]    p        = { };
                            for (int i = 0; i < poList.Length; i++)
                            {
                                if (poList[i].ToString() != "")
                                {
                                    p = poList[i].Split(',');
                                    Point point = new Point(Convert.ToInt32(p[0]), Convert.ToInt32(p[1]));
                                    dpy.pointArray.Add(point);
                                }
                            }
                            dpy.ID = Convert.ToInt32(xmlE.GetAttribute("ID"));
                            frmImgProcess.imgProcess.drawArea.GraphicsList.UnselectAll();
                            frmImgProcess.imgProcess.drawArea.GraphicsList.Add(dpy);
                            frmImgProcess.imgProcess.drawArea.Capture = true;
                            frmImgProcess.imgProcess.drawArea.Refresh();
                            break;

                        case "TextBox":
                            ToolText tx = new ToolText(frmImgProcess.imgProcess.drawArea);
                            tx.Location     = new Point(Convert.ToInt32(xmlE.GetAttribute("X")), Convert.ToInt32(xmlE.GetAttribute("Y")));
                            tx.Width        = Convert.ToInt32(xmlE.GetAttribute("Width"));
                            tx.Height       = Convert.ToInt32(xmlE.GetAttribute("Height"));
                            tx.Name         = xmlE.GetAttribute("ID");
                            tx.Min          = true;
                            tx.Max          = true;
                            tx.IsChangeSize = true;
                            tx.ReadOnly     = false;
                            tx.IsMove       = true;
                            tx.Text         = xmlE.GetAttribute("Content");
                            tx.ForeColor    = System.Drawing.Color.Red;
                            frmImgProcess.imgProcess.drawArea.Controls.Add(tx);
                            break;

                        case "Process":
                            XmlNode nodeProcess = xmlDoc.SelectSingleNode("PatientBackImage/Image[@Name='" + ImageName + "']/Process ");
                            if (nodeProcess != null)
                            {
                                if (nodeProcess.HasChildNodes)
                                {
                                    XmlNodeList xmlNodeProcesslist = nodeProcess.ChildNodes;
                                    foreach (XmlNode xn2 in xmlNodeProcesslist)
                                    {
                                        XmlElement xmlE2 = (XmlElement)xn2;

                                        switch (xmlE2.Name)
                                        {
                                        case "BrightnessCorrection":        //亮度
                                            BrightnessCorrection brightnesscorr = new BrightnessCorrection();
                                            brightnesscorr.AdjustValue = double.Parse(xmlE2.GetAttribute("Value"));
                                            frmImgProcess.imgProcess.ApplyFilter(brightnesscorr);
                                            break;

                                        case "ContrastCorrection":        //对比
                                            ContrastCorrection contrastCorr = new ContrastCorrection();
                                            contrastCorr.Factor = double.Parse(xmlE2.GetAttribute("Value"));
                                            frmImgProcess.imgProcess.ApplyFilter(contrastCorr);
                                            break;

                                        case "HueModifier":        //色相
                                            HueModifier huemodifier = new HueModifier();
                                            huemodifier.Hue = int.Parse(xmlE2.GetAttribute("Value"));
                                            frmImgProcess.imgProcess.ApplyFilter(huemodifier);
                                            break;

                                        case "Saturation":        //饱和度
                                            SaturationCorrection saturationcorr = new SaturationCorrection();
                                            saturationcorr.AdjustValue = double.Parse(xmlE2.GetAttribute("Value"));
                                            frmImgProcess.imgProcess.ApplyFilter(saturationcorr);
                                            break;

                                        case "GrayscaleBT709":        //灰度
                                            GrayscaleBT709 grayscalebt = new GrayscaleBT709();
                                            frmImgProcess.imgProcess.ApplyFilter(grayscalebt);
                                            break;

                                        case "Filter":        //过滤
                                            ColorFiltering colorfilter = new ColorFiltering();
                                            IntRange       red = new IntRange(0, 255);
                                            IntRange       green = new IntRange(0, 255);
                                            IntRange       blue = new IntRange(0, 255);
                                            byte           fillR = 0, fillG = 0, fillB = 0;
                                            string         fillType = "";
                                            red.Min               = int.Parse(xmlE2.GetAttribute("RedMin"));
                                            red.Max               = int.Parse(xmlE2.GetAttribute("RedMax"));
                                            green.Min             = int.Parse(xmlE2.GetAttribute("GreenMin"));
                                            green.Max             = int.Parse(xmlE2.GetAttribute("GreenMax"));
                                            blue.Min              = int.Parse(xmlE2.GetAttribute("BlueMin"));
                                            blue.Max              = int.Parse(xmlE2.GetAttribute("BlueMax"));
                                            fillR                 = byte.Parse(xmlE2.GetAttribute("FillRed"));
                                            fillG                 = byte.Parse(xmlE2.GetAttribute("FillGreen"));
                                            fillB                 = byte.Parse(xmlE2.GetAttribute("FillBlue"));
                                            fillType              = xmlE2.GetAttribute("FillType");
                                            colorfilter.Red       = red;
                                            colorfilter.Green     = green;
                                            colorfilter.Blue      = blue;
                                            colorfilter.FillColor = new RGB(fillR, fillG, fillB);
                                            if (fillType == "OutSide")
                                            {
                                                colorfilter.FillOutsideRange = true;
                                            }
                                            else
                                            {
                                                colorfilter.FillOutsideRange = false;
                                            }
                                            frmImgProcess.imgProcess.ApplyFilter(colorfilter);
                                            break;

                                        case "Gaussian":        //柔化
                                            GaussianBlur gaussianBlur = new GaussianBlur();
                                            gaussianBlur.Sigma = double.Parse(xmlE2.GetAttribute("Sigma"));
                                            gaussianBlur.Size  = int.Parse(xmlE2.GetAttribute("Size"));
                                            frmImgProcess.imgProcess.ApplyFilter(gaussianBlur);
                                            break;

                                        case "DifferenceEdgeDetector":        //边缘增强
                                            DifferenceEdgeDetector differenceEdgeD = new DifferenceEdgeDetector();
                                            frmImgProcess.imgProcess.ApplyFilter(differenceEdgeD);
                                            break;

                                        case "RotateFlip":        //镜像
                                            frmImgProcess.imgProcess.drawArea.Image.RotateFlip(RotateFlipType.RotateNoneFlipX);
                                            frmImgProcess.imgProcess.drawArea.Refresh();
                                            break;

                                        case "PerlinNoise":        //去噪
                                            string value = "";
                                            value = xmlE2.GetAttribute("Value");

                                            float imageWidth  = 0;
                                            float imageHeight = 0;
                                            switch (value)
                                            {
                                            case "Marble":
                                                filter = new Texturer(new MarbleTexture(imageWidth / 96, imageHeight / 48), 0.7f, 0.3f);
                                                break;

                                            case "Wood":
                                                filter = new Texturer(new WoodTexture(), 0.7f, 0.3f);
                                                break;

                                            case "Clouds":
                                                filter = new Texturer(new CloudsTexture(), 0.7f, 0.3f);
                                                break;

                                            case "Labyrinth":
                                                filter = new Texturer(new LabyrinthTexture(), 0.7f, 0.3f);
                                                break;

                                            case "Textile":
                                                filter = new Texturer(new TextileTexture(), 0.7f, 0.3f);
                                                break;

                                            case "Dirty":
                                                TexturedFilter f = new TexturedFilter(new CloudsTexture(), new Sepia());
                                                f.PreserveLevel = 0.30f;
                                                f.FilterLevel   = 0.90f;
                                                filter          = f;
                                                break;

                                            case "Rusty":
                                                filter = new TexturedFilter(new CloudsTexture(), new Sepia(), new GrayscaleBT709());
                                                break;
                                            }
                                            frmImgProcess.imgProcess.ApplyFilter(filter);
                                            break;

                                        case "Sharpen":
                                            Sharpen sharpen = new Sharpen();
                                            frmImgProcess.imgProcess.ApplyFilter(sharpen);
                                            break;

                                        case "Mean":
                                            Mean mean = new Mean();
                                            frmImgProcess.imgProcess.ApplyFilter(mean);
                                            break;
                                        }
                                    }
                                }
                            }
                            break;
                        }
                    }
                }
            }
        }