Ejemplo n.º 1
0
        public StarfieldImage(string path)
        {
            if (!File.Exists(path))
                throw new FileNotFoundException();

            try
            {
                image = new ImageManager(path);
            }
            catch
            {
                throw;
            }

            filters = new List<IFilter>();
            objects = new List<SkyObject>();
        }
Ejemplo n.º 2
0
        public void BuildOverlay(int width, int height, PixelFormat pixelFormat)
        {
            try { image.Dispose(); }
            catch { }

            image = new ImageManager(width, height, Color.Black, pixelFormat);
            image.Unlock();

            for (int i = 0; i < objects.Length; i++)
            {
                Rectangle r = objects[i].ObjectBlob.Rectangle;
                Drawing.Rectangle(image.workingImage, r, Color.Red);
                for (int j = 1; j < thickness; j++)
                {
                    r = new Rectangle(r.X - 1, r.Y - 1, r.Width + 2, r.Height + 2);
                    Drawing.Rectangle(image.workingImage, r, Color.Red);
                }
            }
            image.Lock();

            image.CopyDisplayToBacking();
        }
Ejemplo n.º 3
0
 public frmCustomFilter(ref Bitmap img)
 {
     InitializeComponent();
     image = new ImageManager(img);
 }
Ejemplo n.º 4
0
        public void Dispose()
        {
            try { image.Dispose(); }
            catch { }

            try { overlay.Dispose(); }
            catch { }

            image = null;
            overlay = null;
        }