Example #1
0
        private Bitmap AssembleCBlockFoot(int width, ABC abc)
        {
            Bitmap ret = new Bitmap(width, abc.A.Height, System.Drawing.Imaging.PixelFormat.Format32bppPArgb);

            using (Graphics g = Graphics.FromImage(ret))
            {
                g.FastSettings();
                g.Clear(Color.Transparent);

                g.DrawImageUnscaled(abc.A, 0, 0);

                Rectangle r = new Rectangle(abc.A.Width, 0, width - (abc.A.Width + abc.C.Width), abc.A.Height);
                g.DrawImage(abc.B, r);

                g.DrawImageUnscaled(abc.C, width - abc.C.Width, 0);
            }
            return(ret);
        }
Example #2
0
        public void FromBitmapCutting(Bitmap fullBmp, Color mark)
        {
            fullBmp.MakeTransparent(fullBmp.GetPixel(0, 0));
            Bitmap[] vertPieces = fullBmp.SplitVerticalByCol0(mark);
            vertPieces = vertPieces.Select(b => b.TrimTrailingRight(Color.Transparent)).ToArray();

            /*
            for (int i = 0; i < vertPieces.Length; ++i)
                vertPieces[i].Save("vertPiece" + i + ".png");
             */

            Head = new NineContent();
            Head.FromBitmapCutting(vertPieces[0], mark);

            Side = new A1A2A3();
            Side.FromBitmapCutting(vertPieces[1].SliceX(1).SplitHorizontaByRow0(Color.Red)[0], mark);

            Waist = new NineContent();

            Waist.FromBitmapCutting(vertPieces[2], mark);

            FootCap = new ABC();
            FootCap.FromBitmapCutting(vertPieces[3].SliceX(2), mark);

            FootStack = new ABC();
            FootStack.FromBitmapCutting(vertPieces[4].SliceX(2), mark);
        }
Example #3
0
        private Bitmap AssembleCBlockFoot(int width, ABC abc)
        {
            Bitmap ret = new Bitmap(width, abc.A.Height, System.Drawing.Imaging.PixelFormat.Format32bppPArgb);
            using (Graphics g = Graphics.FromImage(ret))
            {
                g.FastSettings();
                g.Clear(Color.Transparent);

                g.DrawImageUnscaled(abc.A, 0, 0);

                Rectangle r = new Rectangle(abc.A.Width, 0, width - (abc.A.Width + abc.C.Width), abc.A.Height);
                g.DrawImage(abc.B, r);

                g.DrawImageUnscaled(abc.C, width - abc.C.Width, 0);
            }
            return ret;
        }