Beispiel #1
0
        //public static Rectangle GetRectangleImgWithoutTransparentMarc(this Bitmap bmp)
        //{
        //    int x = 0, y = 0, width = bmp.Width, height = bmp.Height;
        //    unsafe
        //    {
        //        byte*[] ptrs;
        //        Utilitats.V2.Color* ptColor;
        //        if (width < height)
        //        {
        //            //height
        //        }
        //        else
        //        {
        //            //width
        //        }

        //    }
        //    return new Rectangle(x, y, width, height);
        //}
        //public static Bitmap GetImgWithoutTransparentMarc(this Bitmap bmp)
        //{
        //    return bmp.Recorta(bmp.GetRectangleImgWithoutTransparentMarc());
        //}
        #endregion
        public static Bitmap Recorta(this Bitmap bmp, Rectangle rctRecorte)
        {
            Bitmap bmpSinMarco = new Bitmap(rctRecorte.Width, rctRecorte.Height, Drawing.ImageBase.DefaultPixelFormat);

            Drawing.ImageBase imgBase = new Drawing.ImageBase(bmp);
            bmpSinMarco.SetFragment(imgBase.Array, bmp.Size, Drawing.ImageBase.ISARGB, rctRecorte.Location);
            return(bmpSinMarco);
        }
Beispiel #2
0
 public static void SetFragment(this Bitmap bmpTotal, Bitmap bmpFragmento, Point posicionFragmento = default)
 {
     Drawing.ImageBase img = new Drawing.ImageBase(bmpFragmento);
     SetFragment(bmpTotal, img.Array, bmpFragmento.Size, Drawing.ImageBase.ISARGB, posicionFragmento);
 }