Esempio n. 1
0
    protected void RenderSpots(Gtk.Image image, Pixbuf input, int OriginX, int OriginY)
    {
        CopyToImage(image, input, OriginX, OriginY);

        if (Spots.Count > 0)
        {
            foreach (var spot in Spots)
            {
                var x = Convert.ToInt32(spot.X) - OriginX;
                var y = Convert.ToInt32(spot.Y) - OriginY;

                if (x >= 0 && x < Parameters.WindowX && y >= 0 && y < Parameters.WindowY)
                {
                    var pixbuf = image.Pixbuf;

                    var ptr = pixbuf.Pixels + y * pixbuf.Rowstride + x * pixbuf.NChannels;

                    for (var offset = 0; offset < pixbuf.NChannels; offset++)
                    {
                        Marshal.WriteByte(ptr, offset, 255);
                    }
                }
            }

            image.QueueDraw();
        }
    }
    protected void CopyToImage(Gtk.Image image, Pixbuf pixbuf, int OriginX, int OriginY)
    {
        if (pixbuf != null && image.Pixbuf != null)
        {
            image.Pixbuf.Fill(0);

            pixbuf.CopyArea(OriginX, OriginY, Math.Min(image.WidthRequest, pixbuf.Width), Math.Min(image.HeightRequest, pixbuf.Height), image.Pixbuf, 0, 0);

            image.QueueDraw();
        }
    }
Esempio n. 3
0
        public bool QueueDraw()
        {
            lock (AdjustedPixbuf) {
                if (view.Transform != null)
                {
                    view.Transform.Dispose();
                }

                view.Transform = next_transform;
                view.QueueDraw();

                hist.FillValues(AdjustedPixbuf);
                histogram_image.QueueDraw();
            }
            return(false);
        }
Esempio n. 4
0
        private void Redraw()
        {
            TooltipText = GetToolTip();
            using (Gdk.GC gc = new Gdk.GC(map))
            {
                gc.Colormap = Gdk.Colormap.System;

                gc.RgbFgColor = new Color(255, 255, 255);
                map.DrawRectangle(gc, true, 0, 0, Diameter, Diameter);

                // Paint a black ring
                gc.RgbFgColor = new Color(0, 0, 0);
                map.DrawArc(gc, true, Radius / 2, Radius / 2, Radius, Radius, 0, 360 * 64);

                // Paint the inner colour
                gc.RgbFgColor = GetColour();
                map.DrawArc(gc, true, Radius / 2 + 1, Radius / 2 + 1, Radius - 2, Radius - 2, 0, 360 * 64);
            }
            image.QueueDraw();
        }
Esempio n. 5
0
 void ProgressiveUpdatedCallback(object obj, AreaUpdatedArgs args)
 {
     progressiveImage.QueueDraw();
 }
Esempio n. 6
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //Graphics

        private void ChangeImage(Gtk.Image image, Pixbuf pixbuf)
        {
            image.Pixbuf = pixbuf;
            image.QueueDraw();
        }