Ejemplo n.º 1
0
        protected override void Dispose(bool disposing)
        {
            try
            {
                StopTimer(pulseTimer);
                StopTimer(mouseTimer);
                if (disposing)
                {
                    if (surfaceCache != null)
                    {
                        surfaceCache.Delete();
                        surfaceCache = null;
                    }

                    if (surfaceImage != null)
                    {
                        surfaceImage.Dispose();
                        surfaceImage = null;
                    }

                    if (pulsarPen != null)
                    {
                        pulsarPen.Dispose();
                        pulsarPen = null;
                    }
                }
            }
            finally
            {
                base.Dispose(disposing);
            }
        }
Ejemplo n.º 2
0
 public Pulsar()
     : base()
 {
     Name            = "Pulsar";
     pulsarPen       = new Pen(Brushes.Pink, 2.0f);
     frequency       = 100;
     TopMostWindow   = true;
     surfaceImage    = NativeThemeManager.LoadBitmap("Pulsar.png");
     surfaceImage    = BitmapPainter.ResizeBitmap(surfaceImage, Dimension, Dimension, true);
     surfaceCache    = new CachedBitmap(surfaceImage, this.Canvas);
     Text            = "Krento Pulsar";
     VerticalShift   = -1;
     HorizontalShift = 1;
 }
Ejemplo n.º 3
0
        protected override void OnSizeChanged(EventArgs e)
        {
            base.OnSizeChanged(e);
            if (surfaceCache != null)
            {
                surfaceCache.Dispose();
                surfaceCache = null;
            }
            if (surfaceImage != null)
            {
                surfaceCache = new CachedBitmap(surfaceImage, this.Canvas);
            }
            else
            {
                surfaceCache = null;
            }

            if (Canvas != null)
            {
                Canvas.SmoothingMode      = smoothingMode;
                Canvas.CompositingQuality = compositingQuality;
                Canvas.InterpolationMode  = interpolationMode;
            }
        }