public MClipElement Clone(MClipsManager p_baseClipsManagerT)
 {
     MClipElement newClip = new MClipElement(p_baseClipsManagerT);
     newClip.imageElement = imageElement;
     newClip.clipRect = clipRect;
     newClip.imgClip = imgClip;
     return newClip;
 }
        public MClipElement Clone()
        {
            MClipElement newClip = new MClipElement(clipsManager);

            newClip.imageElement = imageElement;
            newClip.clipRect     = clipRect;
            return(newClip);
        }
        public MClipElement Clone(MClipsManager p_baseClipsManagerT)
        {
            MClipElement newClip = new MClipElement(p_baseClipsManagerT);

            newClip.imageElement = imageElement;
            newClip.clipRect     = clipRect;
            newClip.imgClip      = imgClip;
            return(newClip);
        }
 public bool equalsClip(MClipElement clip)
 {
     if ((imageElement != null && clip.imageElement == null) ||
         (imageElement == null && clip.imageElement != null) ||
         (imageElement != null && (!imageElement.equalsOnName(clip.imageElement))))
     {
         return(false);
     }
     if (!clipRect.Equals(clip.clipRect))
     {
         return(false);
     }
     return(true);
 }
Exemple #5
0
        //获取记录值_切片
        private HistoryValue_Clips getHistoryValue_Clips()
        {
            HistoryValue_Clips HV_Clips = new HistoryValue_Clips();
            MClipsManager      manager  = form_MA.form_MImgsList.MClipsManager;

            HV_Clips.clipsManager = manager;
            for (int i = 0; i < manager.Count(); i++)
            {
                MClipElement clip = manager[i];
                HV_Clips.clipsData.Add(clip.getMClipData());
            }
            HV_Clips.imgListIndex = form_MA.form_MImgsList.listBox_Images.SelectedIndex;
            return(HV_Clips);
        }
 //改变原有数据为现今排列数据
 public void setPos(MClipElement baseClipElement, TileClip tielClip)
 {
     baseClipElement.clipRect.X = tielClip.x;
     baseClipElement.clipRect.Y = tielClip.y;
 }
 public void addClip(MClipElement baseClipElement)
 {
     TileClip tielClip = new TileClip(baseClipElement.imageElement,baseClipElement.clipRect, xAddUp, yAddUp);
     tileClipsArray.Add(tielClip);//加入切片数据
     Image imgClip = new Bitmap(tielClip.clipRect.Width, tielClip.clipRect.Height);
     Graphics g = Graphics.FromImage(imgClip);
     GraphicsUtil.drawClip(g, tielClip.imageElement.image, 0, 0, tielClip.clipRect.X, tielClip.clipRect.Y, tielClip.clipRect.Width, tielClip.clipRect.Height, 0);
     imgClipsArray.Add(imgClip);//加入切片图片
     g.Dispose();
     //累加坐标
     xAddUp += tielClip.clipRect.Width;
     wAddUp = xAddUp;
     if (hAddUp < tielClip.clipRect.Height)
     {
         hAddUp = tielClip.clipRect.Height;
     }
 }
 public TileClip conatainsClip(MClipElement baseClipElementP)
 {
     for (int i = 0; i < tileClipsArray.Count; i++)
     {
         TileClip tileClip = (TileClip)tileClipsArray[i];
         if (tileClip.imageElement.Equals(baseClipElementP.imageElement) && tileClip.clipRect.Equals(baseClipElementP.clipRect))
         {
             return tileClip;
         }
     }
     return null;
 }
 public OptmizeClip(MClipElement clipT)
 {
     clipElement = clipT;
     clipRectOld = clipElement.clipRect;
 }
 public MClipElement Clone()
 {
     MClipElement newClip = new MClipElement(clipsManager);
     newClip.imageElement = imageElement;
     newClip.clipRect = clipRect;
     return newClip;
 }
 public bool equalsClip(MClipElement clip)
 {
     if ((imageElement != null && clip.imageElement == null) ||
         (imageElement == null && clip.imageElement != null) ||
         (imageElement != null && (!imageElement.equalsOnName(clip.imageElement))))
     {
         return false;
     }
     if (!clipRect.Equals(clip.clipRect))
     {
         return false;
     }
     return true;
 }