Esempio n. 1
0
        private static BitmapImage LoadImage(ImagePlus image)
        {
            BitmapImage newImage = new BitmapImage(new Uri(image.Path));    // Not using OnLoad Cache Option for optimization

            // newImage.Freeze();
            return(newImage);
        }
Esempio n. 2
0
        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);
        }
 public int setup(String arg0, ImagePlus arg1)
 {
     return(DOES_RGB);
 }