示例#1
0
文件: BrushDemo.cs 项目: misiek/foo
        private void CreateObjects()
        {
            brSolid = new SolidBrushPlus(Color.CornflowerBlue);

            brHatch = new HatchBrush(HatchStyle.HatchStyle25Percent,
                Color.Black, Color.White);

            string bitmapPath = System.IO.Path.GetDirectoryName(GetType().Assembly.GetModules()[0].FullyQualifiedName);
            bitmapPath = System.IO.Path.Combine(bitmapPath, "brushPattern.bmp");
            StreamOnFile sf = new StreamOnFile(bitmapPath);
            ImagePlus img = new ImagePlus(sf, false);
            brTexture = new TextureBrushPlus(img, WrapMode.WrapModeTile);
            brLinGrad = new LinearGradientBrush(new GpPointF(0, 0),
                new GpPointF(50, 50), Color.Black, Color.White);

            // Create rectangular path
            GraphicsPath path = new GraphicsPath(FillMode.FillModeAlternate);
            path.AddRectangle(new GpRectF( 0, 0, ClientRectangle.Width,
                ClientRectangle.Height / 5));

            // Create rectangular gradient brush
            // with red in center and black in the corners
            brPathGrad = new PathGradientBrush(path);
            brPathGrad.SetCenterColor(Color.Red);
            int count = 2;
            brPathGrad.SetSurroundColors(new Color[] { Color.Black, Color.Black },
                ref count);
        }
示例#2
0
文件: MainForm.cs 项目: misiek/foo
        private void MainForm_Load(object sender, EventArgs e)
        {
            GpStatusPlus stat = NativeMethods.GdiplusStartup(out token, input, out output);
            string bitmapPath = System.IO.Path.GetDirectoryName(GetType().Assembly.GetModules()[0].FullyQualifiedName);
            bitmapPath = System.IO.Path.Combine(bitmapPath, "test.jpg");
            StreamOnFile sf = new StreamOnFile(bitmapPath);
            bmp = new BitmapPlus(sf);
            penWrite = new PenPlus(Color.Blue, 3);

            path = new GraphicsPath(FillMode.FillModeAlternate);
        }