Example #1
0
        public static CutImageClass MakeCutBitmap(this CutImageClass cutImageClass)
        {
            if (cutImageClass.CurDestBitmap == null)//如果CurDestBitmap没数据将直接使用亮度数据
            {
                cutImageClass.CurDestBitmap = BasicMethodClass.RGB2Gray(cutImageClass.srcBitmap);
            }
            int        width = cutImageClass.CurDestBitmap.Width, height = cutImageClass.CurDestBitmap.Height;
            Rectangle  rect = new Rectangle(0, 0, width, height);
            BitmapData VisualAttentionBmData = cutImageClass.CurDestBitmap.LockBits(rect, ImageLockMode.ReadWrite, PixelFormat.Format8bppIndexed);

            cutImageClass.FindArea(VisualAttentionBmData);
            cutImageClass.CurDestBitmap.UnlockBits(VisualAttentionBmData);
            cutImageClass.GCSsimp_getLightRegionFromSource(cutImageClass.srcBitmap);
            return(cutImageClass);
        }
Example #2
0
        public static Bitmap OutputAreaBitmap(this CutImageClass cutImageClass)
        {
            int        width = cutImageClass.CurDestBitmap.Width, height = cutImageClass.CurDestBitmap.Height;
            Rectangle  rect = new Rectangle(0, 0, width, height);
            BitmapData VisualAttentionBmData = cutImageClass.CurDestBitmap.LockBits(rect, ImageLockMode.ReadWrite, PixelFormat.Format8bppIndexed);
            Bitmap     areaImage             = new Bitmap(width, height);
            BitmapData areaBmData            = areaImage.LockBits(rect, ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);

            cutImageClass.FindArea(VisualAttentionBmData);
            CutImageClass.DrawingArea(cutImageClass.AreaArr, cutImageClass.fx, areaBmData, VisualAttentionBmData);
            cutImageClass.CurDestBitmap.UnlockBits(VisualAttentionBmData);

            areaImage.UnlockBits(areaBmData);

            return(areaImage);
        }
Example #3
0
        public static CutImageClass MakeThumbnail(this CutImageClass cutImageClass, int width, int height, string mode = "W")
        {
            if (cutImageClass.CurDestBitmap == null)
            {
                cutImageClass.CurDestBitmap = BasicMethodClass
                                              .MakeThumbnail(cutImageClass.srcBitmap, width, height, mode, "jpg");
            }
            else
            {
                cutImageClass.CurDestBitmap = BasicMethodClass
                                              .MakeThumbnail(cutImageClass.CurDestBitmap, width, height, mode, "jpg");
            }

            cutImageClass.curDestImageWidth  = cutImageClass.CurDestBitmap.Width;
            cutImageClass.curDestImageHeight = cutImageClass.CurDestBitmap.Height;

            //mss.Dispose();
            return(cutImageClass);
        }
Example #4
0
 public static Bitmap OutputCurrentDestImage(this CutImageClass cutImageClass)
 {
     return(cutImageClass.CurDestBitmap ?? cutImageClass.srcBitmap);
 }
Example #5
0
 public static CutImageClass MakeVisualAttentionBitmap(this CutImageClass cutImageClass)
 {
     cutImageClass.InitVisualAttentionBitmap();
     return(cutImageClass);
 }