示例#1
0
    public static unsafe Pixbuf ColorAdjust(Pixbuf src, double brightness, double contrast,
					  double hue, double saturation, int src_color, int dest_color)
    {
        Pixbuf adjusted = new Pixbuf (Colorspace.Rgb, src.HasAlpha, 8, src.Width, src.Height);
        PixbufUtils.ColorAdjust (src, adjusted, brightness, contrast, hue, saturation, src_color, dest_color);
        return adjusted;
    }
示例#2
0
    public static unsafe void ColorAdjust(Pixbuf src, Pixbuf dest, 
					       double brightness, double contrast,
					       double hue, double saturation, 
					       int src_color, int dest_color)
    {
        if (src.Width != dest.Width || src.Height != dest.Height)
            throw new Exception ("Invalid Dimensions");

        //Cms.Profile eos10d = new Cms.Profile ("/home/lewing/ICCProfiles/EOS-10D-True-Color-Non-Linear.icm");
        Cms.Profile srgb = Cms.Profile.CreateStandardRgb ();

        Cms.Profile bchsw = Cms.Profile.CreateAbstract (256,
                                0.0,
                                brightness, contrast,
                                hue, saturation, src_color,
                                dest_color);

        Cms.Profile [] list = new Cms.Profile [] { srgb, bchsw, srgb };
        Cms.Transform trans = new Cms.Transform (list,
                             PixbufCmsFormat (src),
                             PixbufCmsFormat (dest),
                             Cms.Intent.Perceptual, 0x0100);

        ColorAdjust (src, dest, trans);

        trans.Dispose ();
        srgb.Dispose ();
        bchsw.Dispose ();
    }
示例#3
0
	public MainWindow () : base (Gtk.WindowType.Toplevel)
	{
		Build ();

		fm = new FlowMeter (ConnectorPin.P1Pin03.Input());
		fm.FlowChanged += FlowChanged;
		fc = new FridgeController (4, ConnectorPin.P1Pin05.Output (), (float)spn_OffTemp.Value,  (float)spn_OnTemp.Value);


		//Setup building the beer image list.
		try
		{

			var img = new Pixbuf ("8BitBeer.bmp");
			BeerImages = new List<Pixbuf> ();
			int beerwidth = 224;
			int beerheight = 224;

			//Builds list of beer images.
			for (int i = 0; i < 11; i++) 
			{
				BeerImages.Add(new Pixbuf (img, beerwidth * i,0, beerwidth, beerheight));
			}
			img_Beer.Pixbuf =BeerImages[0];
		}
		catch(Exception ex) 
		{
			
		}
	}
	public static Pixbuf LoadScaled (string path, int target_width, int target_height,
					 out int original_width, out int original_height)
	{
		Pixbuf pixbuf = new Pixbuf (f_load_scaled_jpeg (path, target_width, target_height,
								out original_width, out original_height));
		g_object_unref (pixbuf.Handle);
		return pixbuf;
	}
示例#5
0
	public static double Fit (Pixbuf pixbuf,
				  int dest_width, int dest_height,
				  bool upscale_smaller,
				  out int fit_width, out int fit_height)
	{
		return Fit (pixbuf.Width, pixbuf.Height, 
			    dest_width, dest_height, 
			    upscale_smaller, 
			    out fit_width, out fit_height);
	}
示例#6
0
	unsafe static Pixbuf CreateEffect (int src_width, int src_height, ConvFilter filter, int radius, int offset, double opacity)
	{
		Pixbuf dest;
		int x, y, i, j;
		int src_x, src_y;
		int suma;
		int dest_width, dest_height;
		int dest_rowstride;
		byte* dest_pixels;

		dest_width = src_width + 2 * radius + offset;
		dest_height = src_height + 2 * radius + offset;
		
		dest = new Pixbuf (Colorspace.Rgb, true, 8, dest_width, dest_height);
		dest.Fill (0);
	  
		dest_pixels = (byte*) dest.Pixels;
		
		dest_rowstride = dest.Rowstride;
	  
		for (y = 0; y < dest_height; y++)
		{
			for (x = 0; x < dest_width; x++)
			{
				suma = 0;

				src_x = x - radius;
				src_y = y - radius;

				/* We don't need to compute effect here, since this pixel will be 
				 * discarded when compositing */
				if (src_x >= 0 && src_x < src_width && src_y >= 0 && src_y < src_height) 
				   continue;

				for (i = 0; i < filter.size; i++)
				{
					for (j = 0; j < filter.size; j++)
					{
						src_y = -(radius + offset) + y - (filter.size >> 1) + i;
						src_x = -(radius + offset) + x - (filter.size >> 1) + j;

						if (src_y < 0 || src_y >= src_height ||
						    src_x < 0 || src_x >= src_width)
						  continue;

						suma += (int) (((byte)0xFF) * filter.data [i * filter.size + j]);
					}
				}
				
				byte r = (byte) (suma * opacity);
				dest_pixels [y * dest_rowstride + x * 4 + 3] = r;
			}
		}
		return dest;
	}
示例#7
0
    protected override void OnShown()
    {
        base.OnShown ();

        imagedata = new ImageData ();
        formsimage1.DataBindings.Add ("ImageData", imagedata, "Pixdata",
            false, DataSourceUpdateMode.OnPropertyChanged);
        Pixbuf pixbuf = new Pixbuf ("logo.png");
        Pixdata pixdata = new Pixdata ();
        pixdata.FromPixbuf (pixbuf, false);
        imagedata.Pixdata = pixdata.Serialize();
    }
	public void AddThumbnail (string path, Pixbuf pixbuf)
	{
		Thumbnail thumbnail = new Thumbnail ();

		thumbnail.path = path;
		thumbnail.pixbuf = pixbuf;

		RemoveThumbnailForPath (path);

		pixbuf_mru.Insert (0, thumbnail);
		pixbuf_hash.Add (path, thumbnail);

		MaybeExpunge ();
	}
	public static byte [] Serialize (Pixbuf pixbuf)
	{
		Pixdata pixdata = new Pixdata ();
		pixdata.FromPixbuf (pixbuf, true); // FIXME GTK# shouldn't this be a constructor or something?

		uint data_length;
		IntPtr raw_data = gdk_pixdata_serialize (ref pixdata, out data_length);

		byte [] data = new byte [data_length];
		Marshal.Copy (raw_data, data, 0, (int) data_length);
		
		GLib.Marshaller.Free (raw_data);

		return data;
	}
示例#10
0
    public About(string version, string translators)
    {
        Glade.XML gladeXML;
        gladeXML = Glade.XML.FromAssembly (Util.GetGladePath() + "chronojump.glade", "dialog_about", null);
        gladeXML.Autoconnect(this);

        /*
        //crash for test purposes
        string [] myCrash = {
            "hello" };
        Console.WriteLine("going to crash now intentionally");
        Console.WriteLine(myCrash[1]);
        */

        //put an icon to window
        UtilGtk.IconWindow(dialog_about);

        //put logo image
        Pixbuf pixbuf;
        pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameLogo);
        image_logo.Pixbuf = pixbuf;

        dialog_about_label_version.Text = version;
        dialog_about_label_translators.Text = translators;

        //white bg
        dialog_about.ModifyBg(StateType.Normal, new Gdk.Color(0xff,0xff,0xff));

        //put authors separated by commas
        string authorsString = "";
        string paragraph = "";
        foreach (string singleAuthor in Constants.Authors) {
            authorsString += paragraph;
            authorsString += singleAuthor;
            paragraph = "\n\n";
        }
        dialog_about_label_developers.Text = authorsString;

        //put documenters separated by commas
        string docsString = "";
        paragraph = "";
        foreach (string doc in Constants.Documenters) {
            docsString += paragraph;
            docsString += doc;
            paragraph = "\n\n";
        }
        dialog_about_label_documenters.Text = docsString;
    }
	public static byte [] Serialize (Pixbuf pixbuf)
	{
		Pixdata pixdata = new Pixdata ();
		IntPtr raw_pixdata = pixdata.FromPixbuf (pixbuf, false); // FIXME GTK# shouldn't this be a constructor or something?
									//       It's probably because we need the IntPtr to free it afterwards

		uint data_length;
		IntPtr raw_data = gdk_pixdata_serialize (ref pixdata, out data_length);

		byte [] data = new byte [data_length];
		Marshal.Copy (raw_data, data, 0, (int) data_length);
		
		GLib.Marshaller.Free (new IntPtr[] { raw_data, raw_pixdata });
		
		return data;
	}
示例#12
0
    public static Pixbuf Blur(Pixbuf src, int radius, ThreadProgressDialog dialog)
    {
        ImageSurface sourceSurface = Hyena.Gui.PixbufImageSurface.Create (src);
        ImageSurface destinationSurface = new ImageSurface (Format.Rgb24, src.Width, src.Height);

        // If we do it as a bunch of single lines (rectangles of one pixel) then we can give the progress
        // here instead of going deeper to provide the feedback
        for (int i=0; i < src.Height; i++) {
            GaussianBlurEffect.RenderBlurEffect (sourceSurface, destinationSurface, new[] { new Gdk.Rectangle (0, i, src.Width, 1) }, radius);

            if (dialog != null) {
                // This only half of the entire process
                double fraction = ((double)i / (double)(src.Height - 1)) * 0.75;
                dialog.Fraction = fraction;
            }
        }

        return destinationSurface.ToPixbuf ();
    }
	public Pixbuf GetThumbnailForPath (string path)
	{
		if (! pixbuf_hash.ContainsKey (path))
			return null;

		Thumbnail item = pixbuf_hash [path] as Thumbnail;

		pixbuf_mru.Remove (item);
		pixbuf_mru.Insert (0, item);

		// Shallow Copy
		Pixbuf copy = new Pixbuf (item.pixbuf, 0, 0, 
					  item.pixbuf.Width,
					  item.pixbuf.Height);

		PixbufUtils.CopyThumbnailOptions (item.pixbuf, copy);

		return copy;
	}
示例#14
0
    public RatingWidget()
        : base()
    {
        bigStar = Pixbuf.LoadFromResource ("bigstar.png");
        littleStar = Pixbuf.LoadFromResource ("littlestar.png");

        buttons = new Button[MAX_RATING];
        for (int i=0; i < MAX_RATING; i++) {
            Button button = new Button();
            button.Relief = ReliefStyle.None;
            button.CanFocus = false;
            button.Data["position"] = i;
            this.PackStart (button);
            button.Clicked += OnStarClicked;
            buttons[i] = button;
        }

        Value = 1;
    }
示例#15
0
    public SplashWindow()
    {
        Glade.XML gladeXML;
        gladeXML = Glade.XML.FromAssembly (Util.GetGladePath() + "chronojump.glade", "splash_window", null);
        gladeXML.Autoconnect(this);

        //put an icon to window
        UtilGtk.IconWindow(splash_window);

        fakeButtonCancel = new Gtk.Button();
        FakeButtonCreated = true;

        CancelButtonShow(false);
        hideAllProgressbars();

        //put logo image
        Pixbuf pixbuf;
        pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameLogo320);
        image_logo.Pixbuf = pixbuf;
    }
示例#16
0
    public DialogImageTest(EventType myEventType)
    {
        Glade.XML gladeXML;
        gladeXML = Glade.XML.FromAssembly (Util.GetGladePath() + "chronojump.glade", "dialog_image_test", null);
        gladeXML.Autoconnect(this);

        //put an icon to window
        UtilGtk.IconWindow(dialog_image_test);

        label_name_description.Text = "<b>" + myEventType.Name + "</b>" + " - " + myEventType.Description;
        label_name_description.UseMarkup = true;

        if(myEventType.LongDescription.Length == 0)
            scrolledwindow28.Hide();
        else {
            label_long_description.Text = myEventType.LongDescription;
            label_long_description.UseMarkup = true;
        }

                Pixbuf pixbuf = new Pixbuf (null, Util.GetImagePath(false) + myEventType.ImageFileName);
                image_test.Pixbuf = pixbuf;
    }
示例#17
0
        // Sets the icon for the file
        void SetIcon()
        {
            OperatingSystem os  = Environment.OSVersion;
            PlatformID      pid = os.Platform;

            switch (pid)
            {
            case PlatformID.Win32S:
            case PlatformID.Win32Windows:
            case PlatformID.WinCE:
            case PlatformID.Win32NT:     // <- if one, this is the one we really need
            {
                byte[] buffer = File.ReadAllBytes("..\\..\\..\\Ressources\\Icons\\Gnome-media-floppy.png");
                Pixbuf pixbuf = new Pixbuf(buffer);
                pixbuf       = pixbuf.ScaleSimple(25, 25, InterpType.Bilinear);
                image.Pixbuf = pixbuf;

                break;
            }

            case PlatformID.Unix:
            case PlatformID.MacOSX:
            {
                byte[] buffer = File.ReadAllBytes("../../../Ressources/Icons/Gnome-media-floppy.svg");
                Pixbuf pixbuf = new Pixbuf(buffer);
                pixbuf       = pixbuf.ScaleSimple(25, 25, InterpType.Bilinear);
                image.Pixbuf = pixbuf;

                break;
            }

            default:
            {
                break;
            }
            }
        }
示例#18
0
    public Gtk.Button CreateButton()
    {
        Gtk.VBox vbox = new Gtk.VBox();

        Gtk.Image image     = new Gtk.Image();
        string    photoFile = Util.GetPhotoFileName(true, p.UniqueID);

        if (photoFile != "" && File.Exists(photoFile))
        {
            try {
                Pixbuf pixbuf = new Pixbuf(photoFile);                  //from a file
                image.Pixbuf  = pixbuf;
                image.Visible = true;
            }
            catch {
                LogB.Warning("catched while adding photo");
            }
        }

        Gtk.Label label_id = new Gtk.Label(p.UniqueID.ToString());
        label_id.Visible = false;         //hide this to the user

        Gtk.Label label_name = new Gtk.Label(p.Name);
        label_name.Visible = true;

        vbox.PackStart(image);
        vbox.PackStart(label_id);
        vbox.PackEnd(label_name, false, false, 1);

        vbox.Show();

        Button b = new Button(vbox);

        b.WidthRequest = 150;

        return(b);
    }
        public override void LoadMap(string file)
        {
            if (file == null)
            {
                return;
            }

            /*if (!System.IO.File.Exists(file + ".gif"))
             *      throw new Exception("File: " + file + " doesn't exists");
             *
             * if (!System.IO.File.Exists(file + ".txt"))
             *      throw new Exception("File: " + file + ".txt doesn't exists");
             */
            fileName = file;


            System.IO.StreamReader Stremread = new System.IO.StreamReader(file + ".txt");

            startPoint = new Coordinate(
                Convert.ToDouble(Stremread.ReadLine()),
                Convert.ToDouble(Stremread.ReadLine()));

            stopPoint = new Coordinate(
                Convert.ToDouble(Stremread.ReadLine()),
                Convert.ToDouble(Stremread.ReadLine()));

            Pixbuf mine = new Pixbuf(file + ".gif");

            mapImage  = new Gtk.Image(mine);
            miniImage = new Gtk.Image(mine);


            pixPerGradX = (startPoint.Longitude - stopPoint.Longitude) / mapImage.Pixbuf.Width;
            pixPerGradY = -(startPoint.Latitude - stopPoint.Latitude) / mapImage.Pixbuf.Height;

            mapLoaded = true;
        }
示例#20
0
文件: App.cs 项目: hadi77ir/monodm
        internal StatusIcon CreateTray(Pixbuf icon)
        {
            // Creation of the Icon
            var trayIcon = new StatusIcon(icon);

            // Show/Hide the window (even from the Panel/Taskbar) when the TrayIcon has been clicked.
            EventHandler restoreLambda = (s, e) => { MainWindow.Show(); };

            trayIcon.Activate += restoreLambda;
            // Add menu to tray icon
            Menu menu = new Menu();

            // Add menu items
            MenuItem item;

            item            = new MenuItem("Restore");
            item.Activated += restoreLambda;
            menu.Add(item);

            item            = new MenuItem("Exit");
            item.Activated += (sender, e) => {
                Quit();
            };
            menu.Add(item);


            trayIcon.PopupMenu += (sender, e) => {
                menu.ShowAll();
                menu.Popup();
            };

            // A Tooltip for the Icon
            trayIcon.Tooltip = "MonoDM";
            trayIcon.Visible = true;

            return(trayIcon);
        }
示例#21
0
        // these methods all assume that the BitsPerSample is 8 (byte).  Pixbuf documentation
        // states that values from 1-16 are allowed, but currently only 8 bit samples are supported.
        // http://library.gnome.org/devel/gdk-pixbuf/unstable/gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf--bits-per-sample

        /// <summary>
        /// Applies a color transformation to each pixel in a pixbuf.
        /// </summary>
        /// <param name="colorTransform">
        /// A <see cref="Func<Cairo.Color, Cairo.Color>"/>
        /// </param>
        /// <returns>
        /// A reference to the input Pixbuf (the 'this' reference).
        /// </returns>
        public static Pixbuf PixelColorTransform(this Pixbuf source, Func <Cairo.Color, Cairo.Color> colorTransform)
        {
            try {
                if (source.BitsPerSample != 8)
                {
                    throw new Exception("Pixbuf does not have 8 bits per sample, it has " + source.BitsPerSample);
                }

                unsafe {
                    double r, g, b;
                    byte * pixels = (byte *)source.Pixels;
                    for (int i = 0; i < source.Height * source.Rowstride / source.NChannels; i++)
                    {
                        r = (double)pixels[0];
                        g = (double)pixels[1];
                        b = (double)pixels[2];

                        Cairo.Color color = new Cairo.Color(r / byte.MaxValue,
                                                            g / byte.MaxValue,
                                                            b / byte.MaxValue);

                        color = colorTransform.Invoke(color);

                        pixels[0] = (byte)(color.R * byte.MaxValue);
                        pixels[1] = (byte)(color.G * byte.MaxValue);
                        pixels[2] = (byte)(color.B * byte.MaxValue);

                        pixels += source.NChannels;
                    }
                }
            } catch (Exception e) {
                Log <DrawingService> .Error("Error transforming pixbuf: {0}", e.Message);

                Log <DrawingService> .Debug(e.StackTrace);
            }
            return(source);
        }
示例#22
0
    public PreferencesWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Build();

        // preload the status iconset
        iconBlank   = ImageToPixbuf(ClientGtk.Properties.Resources.box_blank);
        iconError   = ImageToPixbuf(ClientGtk.Properties.Resources.box_red);
        iconWorking = ImageToPixbuf(ClientGtk.Properties.Resources.box_blue);
        iconReady   = ImageToPixbuf(ClientGtk.Properties.Resources.box_green);


        trayIcon = new StatusIcon(iconBlank);

        // Creation of the Icon
        trayIcon.Visible = true;

        // Show/Hide the window (even from the Panel/Taskbar) when the TrayIcon has been clicked.
        //trayIcon.Activate += delegate { window.Visible = !window.Visible; };
        // Show a pop up menu when the icon has been right clicked.
        trayIcon.PopupMenu += OnTrayIconPopup;

        // A Tooltip for the Icon
        trayIcon.Tooltip = "Mybox";


//    textviewMessages.Buffer.InsertAtCursor("Ahoy!");

        TextIter insertIter;

        insertIter = textviewMessages.Buffer.GetIterAtMark(textviewMessages.Buffer.InsertMark);
//    textviewMessages.Buffer.Insert(insertIter, "Ahoy again!");

        // start the process
        workerThread = new Thread(new ThreadStart(doWork));
        workerThread.Start();
    }
示例#23
0
        public AvatarManager(Core core)
        {
            this.core = core;

            genericAvatar      = new Pixbuf(null, "Meshwork.Client.GtkClient.avatar-generic-large.png");
            smallGenericAvatar = new Pixbuf(null, "Meshwork.Client.GtkClient.avatar-generic-medium.png");
            miniGenericAvatar  = new Pixbuf(null, "Meshwork.Client.GtkClient.avatar-generic-small.png");

            avatarsPath = Path.Combine(Settings.ConfigurationDirectory, "avatars");

            if (Directory.Exists(avatarsPath) == false)
            {
                Directory.CreateDirectory(avatarsPath);
            }

            foreach (Network network in core.Networks)
            {
                AddNetwork(network);
            }

            core.NetworkAdded += AddNetwork;

            UpdateMyAvatar();
        }
示例#24
0
            // Delegate Functions
            // Delegate Functions :: ThreadFunc
            /// <summary>
            ///	Downloads the cover and sets it in the database.
            /// </summary>
            /// <remarks>
            ///	This is the main method of the thread.
            /// </remarks>
            private void ThreadFunc()
            {
                try {
                    pixbuf = getter.Download(url);
                    pixbuf = getter.AddBorder(pixbuf);
                } catch {
                }

                // Check if cover has been modified while we were downloading
                if (Global.CoverDB.Covers [key] != null)
                {
                    return;
                }

                if (pixbuf != null)
                {
                    Global.CoverDB.SetCover(key, pixbuf);
                }

                // Also do this if it is null, as we need to remove the
                // downloading image
                GLib.IdleHandler idle = new GLib.IdleHandler(SignalIdle);
                GLib.Idle.Add(idle);
            }
示例#25
0
    public static void Simple(OpenCV cv, Pixbuf pixbuf, Select selection, double ScaleX, double ScaleY)
    {
        if (pixbuf != null)
        {
            var parameters = new SimpleBlobDetectorParams
            {
                MinArea      = MinArea,
                MaxArea      = MaxArea,
                FilterByArea = true
            };

            cv.InitSimpleBlobDetector(parameters);

            using (var mat = cv.ToMat(pixbuf))
            {
                cv.SimpleBlobDetectionMat(
                    mat,
                    selection,
                    ScaleX,
                    ScaleY
                    );
            }
        }
    }
示例#26
0
 private void _twain32_AcquireCompleted(object sender, EventArgs e)
 {
     logger.Debug("Acquire Completed");
     //FIXME Если не будет использоваться нативный режим событие не нужно.
     TotalImages = _twain32.ImageCount;
     for (int i = 0; i < _twain32.ImageCount; i++)
     {
         System.Drawing.Image WinImg = _twain32.GetImage(i);
         Pixbuf CurImg = WinImageToPixbuf(WinImg);
         WinImg.Dispose();
         if (ImageTransfer == null)
         {                // Записываем во внутренний массив
             Images.Add(CurImg);
         }
         else
         {                // Передаем через событие
             ImageTransferEventArgs arg = new ImageTransferEventArgs();
             arg.AllImages = TotalImages;
             arg.Image     = CurImg;
             ImageTransfer(this, arg);
         }
     }
     logger.Debug("Data Transferred");
 }
            void LoadBranding()
            {
                try
                {
                    var textColStr = BrandingService.GetString("AboutBox", "TextColor");
                    if (textColStr != null)
                    {
                        Gdk.Color.Parse(textColStr, ref textColor);
                    }
                    var bgColStr = BrandingService.GetString("AboutBox", "BackgroundColor");
                    if (bgColStr != null)
                    {
                        Gdk.Color.Parse(bgColStr, ref bgColor);
                    }

                    //branders may provide either fg image or bg image, or both
                    using (var stream = BrandingService.GetStream("AboutImage.png", false))
                    {
                        image = (stream != null ? new Gdk.Pixbuf(stream) : null);
                    }
                    using (var streamBg = BrandingService.GetStream("AboutImageBg.png", false))
                    {
                        imageBg = (streamBg != null ? new Gdk.Pixbuf(streamBg) : null);
                    }

                    //if branding did not provide any image, use the built-in one
                    if (imageBg == null && image == null)
                    {
                        image = Gdk.Pixbuf.LoadFromResource("AboutImage.png");
                    }
                }
                catch (Exception ex)
                {
                    LoggingService.LogError("Error loading about box branding", ex);
                }
            }
示例#28
0
        public Gdk.Pixbuf GetIcon(string image)
        {
            if (!_IconsCache.ContainsKey(image))
            {
                Pixbuf pixbuf = null;

                try
                {
                    pixbuf = new Pixbuf(image);
                }
                catch
                {
                    Console.WriteLine("missing image file: " + image);
                    return(null);
                }

                if (pixbuf != null)
                {
                    _IconsCache[image] = pixbuf.ScaleSimple(32, 32, InterpType.Hyper);
                }
            }

            return(_IconsCache[image]);
        }
示例#29
0
        void SetSplashBG()
        {
            string[] files;
            if (showChristmasSplash)
            {
                files = Directory.GetFiles("./icons/splash/christmas");
            }
            else
            {
                files = Directory.GetFiles("./icons/splash");
            }
            Random rand = new Random();
            int    idx = rand.Next(files.Length);
            Pixbuf test = new Pixbuf(files[idx], 744, 600);
            Pixmap image, mask;

            this.DoubleBuffered = false;
            test.RenderPixmapAndMask(out image, out mask, 175);
            this.DoubleBuffered = true;
            this.AppPaintable   = true;
            this.GdkWindow.SetBackPixmap(image, false);
            this.ShapeCombineMask(mask, 0, 0);
            this.GdkWindow.InvalidateRect(new Rectangle(0, 0, 744, 600), true);

            if (showChristmasSplash)
            {
                for (int idx2 = 0; idx2 < christmasBG.Length; idx2++)
                {
                    Pixbuf test2 = new Pixbuf(christmasBG[idx2], 744, 600);
                    Pixmap image2, mask2;
                    test2.RenderPixmapAndMask(out image2, out mask2, 175);
                    backgrounds[idx2] = image2;
                    masks[idx2]       = mask2;
                }
            }
        }
    EncoderConfigurationWindow(bool definedInConfig)
    {
        Glade.XML gladeXML;
        gladeXML = Glade.XML.FromAssembly(Util.GetGladePath() + "chronojump.glade", "encoder_configuration", "chronojump");
        gladeXML.Autoconnect(this);

        this.definedInConfig = definedInConfig;

        //three encoder types
        pixbuf = new Pixbuf(null, Util.GetImagePath(false) + Constants.FileNameEncoderTypeLinear);
        image_encoder_linear.Pixbuf = pixbuf;

        pixbuf = new Pixbuf(null, Util.GetImagePath(false) + Constants.FileNameEncoderTypeRotaryFriction);
        image_encoder_rotary_friction.Pixbuf = pixbuf;

        pixbuf = new Pixbuf(null, Util.GetImagePath(false) + Constants.FileNameEncoderTypeRotaryAxis);
        image_encoder_rotary_axis.Pixbuf = pixbuf;

        pixbuf = new Pixbuf(null, Util.GetImagePath(false) + Constants.FileNameEncoderCalculeIM);
        image_encoder_calcule_im.Pixbuf = pixbuf;

        //put an icon to window
        UtilGtk.IconWindow(encoder_configuration);
    }
示例#31
0
        public static void ShowCustomerList(List <string> customerList, TreeView treeView, string customerTexPath = null)
        {
            if (customerTexPath == null)
            {
                customerTexPath = AppConfig.sd_path;
            }
            string seperator                  = System.IO.Path.DirectorySeparatorChar.ToString();
            CustomerDataManager _custMgr      = CustomerDataManager.GetInstance();
            ListStore           custListStore = new ListStore(typeof(Pixbuf), typeof(string), typeof(string));

            for (int i = 0; i < customerList.Count; ++i)
            {
                CustomerData cust = _custMgr.GetCustomer(customerList[i]);
                if (cust != null)
                {
                    Pixbuf pixBuf = new Pixbuf(customerTexPath + cust.icon_texture);
                    float  scale  = 80.0f / pixBuf.Height;

                    Pixbuf scaledBuf = pixBuf.ScaleSimple((int)(pixBuf.Width * scale), (int)(pixBuf.Height * scale), InterpType.Bilinear);
                    custListStore.AppendValues(scaledBuf, cust.GetDisplayName("cn"), cust.key);
                }
            }
            treeView.Model = custListStore;
        }
示例#32
0
        public static void ShowFoodList(List <string> foodList, TreeView treeview, string foodTexPath = null)
        {
            if (foodTexPath == null)
            {
                foodTexPath = AppConfig.sd_path;
            }
            FoodDataManager _foodMgr      = FoodDataManager.GetInstance();
            ListStore       foodListStore = new ListStore(typeof(Pixbuf), typeof(string), typeof(string));

            for (int i = 0; i < foodList.Count; ++i)
            {
                FoodData fd = _foodMgr.GetFood(foodList[i]);
                if (fd != null)
                {
                    Pixbuf pixBuf = new Pixbuf(foodTexPath + fd.texture);
                    float  scale  = 60.0f / pixBuf.Height;

                    Pixbuf scaledBuf = pixBuf.ScaleSimple((int)(pixBuf.Width * scale),
                                                          (int)(pixBuf.Height * scale), InterpType.Bilinear);
                    foodListStore.AppendValues(scaledBuf, fd.GetDisplayName("cn"), fd.key);
                }
            }
            treeview.Model = foodListStore;
        }
示例#33
0
        private Pixbuf GetScaled(IBrowsableItem photo)
        {
            Pixbuf orig;

            try {
                orig = FSpot.PhotoLoader.LoadAtMaxSize(photo, Allocation.Width, Allocation.Height);
            } catch {
                orig = null;
            }

            if (orig == null)
            {
                return(null);
            }

            Pixbuf result = GetScaled(orig);

            if (orig != result)
            {
                orig.Dispose();
            }

            return(result);
        }
示例#34
0
        private void CalcPreviewSize(Pixbuf input, out int width, out int height)
        {
            int awidth  = State.PhotoImageView.Allocation.Width;
            int aheight = State.PhotoImageView.Allocation.Height;
            int iwidth  = input.Width;
            int iheight = input.Height;

            if (iwidth <= awidth && iheight <= aheight)
            {
                // Do not upscale
                width  = iwidth;
                height = iheight;
            }
            else
            {
                double wratio = (double)iwidth / awidth;
                double hratio = (double)iheight / aheight;

                double ratio = Math.Max(wratio, hratio);
                width  = (int)(iwidth / ratio);
                height = (int)(iheight / ratio);
            }
            //Log.DebugFormat ("Preview size: Allocation: {0}x{1}, Input: {2}x{3}, Result: {4}x{5}", awidth, aheight, iwidth, iheight, width, height);
        }
示例#35
0
文件: About.cs 项目: balihb/basenji
        public About()
        {
            // general window settings
            if (Gui.Base.WindowBase.MainWindow != null)
            {
                this.TransientFor = Gui.Base.WindowBase.MainWindow;
            }

            this.Modal      = true;
            SkipTaskbarHint = true;

            Icon = Basenji.Icons.Icon.Stock_About.Render(this, IconSize.Menu);

            // about dialog settings
            Logo        = new Pixbuf(App.APP_DATA_PATH + "/basenji.svg", 200, 200);
            ProgramName = App.Name;
            Version     = App.Version;
            Comments    = comments;
            Copyright   = copyright;
            Website     = "http://www.launchpad.net/basenji";
            //WebsiteLabel		= "Basenji Homepage";
            Authors           = authors;
            TranslatorCredits = translatorCredits;
        }
示例#36
0
        void HandleItemChanged(object sender, EventArgs e)
        {
            flip.Stop();
            if (running)
            {
                flip.Start();
            }
            lock (sync_handle) {
                if (prev != null && prev != PixbufUtils.ErrorPixbuf)
                {
                    prev.Dispose();
                }
                prev = next;

                LoadNext();

                if (animation.IsRunning)
                {
                    animation.Stop();
                }
                progress = 0;
                animation.Start();
            }
        }
示例#37
0
		public async Task<Pixbuf> LoadImageAsync(
			ImageSource imagesource,
			CancellationToken cancelationToken = default(CancellationToken),
			float scale = 1)
		{
			Pixbuf image = null;

			var imageLoader = imagesource as UriImageSource;

			if (imageLoader?.Uri == null)
				return null;

			using (Stream streamImage = await imageLoader.GetStreamAsync(cancelationToken))
			{
				if (streamImage == null || !streamImage.CanRead)
				{
					return null;
				}

				image = new Pixbuf(streamImage);
			}

			return image;
		}
示例#38
0
    public SplashWindow()
    {
        Glade.XML gladeXML;
        gladeXML = Glade.XML.FromAssembly(Util.GetGladePath() + "splash_window.glade", "splash_window", "chronojump");
        gladeXML.Autoconnect(this);

        //put an icon to window
        UtilGtk.IconWindow(splash_window);

        FakeButtonClose   = new Gtk.Button();
        FakeButtonCreated = true;

        hideAllProgressbars();

        //hidden always excepted when called to be shown (see below)
        button_open_database_folder.Hide();
        button_open_docs_folder.Hide();

        //put logo image
        Pixbuf pixbuf;

        pixbuf            = new Pixbuf(null, Util.GetImagePath(false) + Constants.FileNameLogo320);
        image_logo.Pixbuf = pixbuf;
    }
示例#39
0
        protected virtual void Dispose(bool disposing)
        {
            if (disposed)
            {
                return;
            }
            disposed = true;

            if (disposing)
            {
                // free managed resources
                if (icon != null)
                {
                    icon.Dispose();
                    icon = null;
                }
                if (cached_icon != null)
                {
                    cached_icon.Dispose();
                    cached_icon = null;
                }
            }
            // free unmanaged resources
        }
            public void Linearize(string name)
            {
                GammaTable table = new GammaTable(new ushort [] { 0x0000, 0x0000, 0x0000, 0x0000 });
                Profile    link  = new Profile(IccColorSpace.Rgb, new GammaTable [] { table, table, table });

                string path = CreateFile(name, 32);

                using (FilterRequest req = new FilterRequest(path)) {
                    ColorFilter filter = new ColorFilter();
                    filter.DeviceLink = link;
                    Assert.IsTrue(filter.Convert(req), "Filter failed to operate");
                    req.Preserve(req.Current);
                    Assert.IsTrue(System.IO.File.Exists(req.Current.LocalPath),
                                  "Error: Did not create " + req.Current);
                    Assert.IsTrue(new FileInfo(req.Current.LocalPath).Length > 0,
                                  "Error: " + req.Current + "is Zero length");
                    using (ImageFile img = ImageFile.Create(req.Current)) {
                        Pixbuf pixbuf = img.Load();
                        Assert.IsNotNull(pixbuf);
                        // We linearized to all black so this should pass the gray test
                        Assert.IsTrue(PixbufUtils.IsGray(pixbuf, 1), "failed to linearize" + req.Current);
                    }
                }
            }
示例#41
0
        protected override void DoSave(Pixbuf pb, string fileName, string fileType, Gtk.Window parent)
        {
            //Load the JPG compression quality, but use the default value if there is no saved value.
            int level = PintaCore.Settings.GetSetting <int> (JpgCompressionQualitySetting, defaultQuality);

            //Check to see if the Document has been saved before.
            if (!PintaCore.Workspace.ActiveDocument.HasBeenSavedInSession)
            {
                //Show the user the JPG export compression quality dialog, with the default
                //value being the one loaded in (or the default value if it was not saved).
                level = PintaCore.Actions.File.RaiseModifyCompression(level, parent);

                if (level == -1)
                {
                    throw new OperationCanceledException();
                }
            }

            //Store the "previous" JPG compression quality value (before saving with it).
            PintaCore.Settings.PutSetting(JpgCompressionQualitySetting, level);

            //Save the file.
            pb.SavevUtf8(fileName, fileType, new string?[] { "quality", null }, new string?[] { level.ToString(), null });
        }
示例#42
0
        public void Refresh()
        {
            browserStore.Clear();

            Gdk.Pixbuf dirIcon = Pixbuf.LoadFromResource("x-directory-remote-server.png");
            rootIter = browserStore.AppendValues(dirIcon, "Servers", "Servers");
            TreePath path = browserStore.GetPath(rootIter);

            if (IsSingle)
            {
                TreeIter iter = browserStore.AppendValues(rootIter, dirIcon, conn.Settings.Name, conn.Settings.Name);
                browserStore.AppendValues(iter, null, "", "");
            }
            else
            {
                foreach (string n in Global.Connections.ConnectionNames)
                {
                    TreeIter iter = browserStore.AppendValues(rootIter, dirIcon, n, n);
                    browserStore.AppendValues(iter, null, "", "");
                }
            }

            this.ExpandRow(path, false);
        }
示例#43
0
        public Task <Pixbuf> LoadImageAsync(
            ImageSource imagesource,
            CancellationToken cancelationToken = default(CancellationToken),
            float scale = 1f)
        {
            Pixbuf image      = null;
            var    filesource = imagesource as FileImageSource;

            if (filesource != null)
            {
                var file = filesource.File;
                if (!string.IsNullOrEmpty(file))
                {
                    var imagePath = IOPath.Combine(AppDomain.CurrentDomain.BaseDirectory, file);

                    if (File.Exists(imagePath))
                    {
                        image = new Pixbuf(imagePath);
                    }
                }
            }

            return(Task.FromResult(image));
        }
    private void createTreeView()
    {
        UtilGtk.RemoveColumns(treeview_select);

        treeview_select.HeadersVisible = true;
        int count = 0;

        treeview_select.AppendColumn(Catalog.GetString("Name"), new CellRendererText(), "text", count++);
        treeview_select.AppendColumn(Catalog.GetString("Description"), new CellRendererText(), "text", count++);

        treeview_select.Selection.Changed += onTVSelectionChanged;

        store = getStore();
        treeview_select.Model = store;

        Pixbuf pixbuf;

        pixbuf = new Pixbuf(null, Util.GetImagePath(false) + Constants.FileNameImport);
        image_import.Pixbuf = pixbuf;
        pixbuf = new Pixbuf(null, Util.GetImagePath(false) + Constants.FileNameExport);
        image_export.Pixbuf = pixbuf;
        pixbuf = new Pixbuf(null, Util.GetImagePath(false) + "stock_delete.png");
        image_delete.Pixbuf = pixbuf;
    }
示例#45
0
    public Pixbuf GetPreviewPixbuf(GPhotoCameraFile camfile)
    {
        CameraFile cfile = GetPreview(camfile);

        if (cfile != null)
        {
            byte[] bytedata = cfile.GetDataAndSize();
            if (bytedata.Length > 0)
            {
                MemoryStream dataStream = new MemoryStream(bytedata);
                try {
                    Gdk.Pixbuf temp = new Pixbuf(dataStream);
                    FSpot.ColorManagement.ApplyScreenProfile(temp);
                    return(temp);
                } catch (Exception e) {
                    // Actual errors with the data libgphoto gives us have been
                    // observed here see b.g.o #357569.
                    Console.WriteLine("Error retrieving preview image");
                    Console.WriteLine(e);
                }
            }
        }
        return(null);
    }
        protected override bool OnExposeEvent(Gdk.EventExpose ev)
        {
            bool r = base.OnExposeEvent(ev);

            //FIXME Disabled checkerboard background because it's very inefficient and makes the control *very* slow to resize
            // It should take the EventExpose area into account, invalidate more selectively during resizes (GTK viewport
            // code would probably be a good start), and take advantage of the flat block color the parent is rendering.

            /*
             * int size = 8;
             * bool squareColor = true;
             * bool startsquareColor = true;
             * int x1 = 0;
             * int x2 = Allocation.Width;
             * int y1 = 0;
             * int y2 = Allocation.Height;
             * for (int y = y1; y < y2; y += size) {
             *      squareColor = startsquareColor;
             *      startsquareColor = !startsquareColor;
             *      for (int x = x1; x < x2; x += size) {
             *              GdkWindow.DrawRectangle (squareColor ? Style.DarkGC (StateType.Normal) : Style.DarkGC (StateType.Active), true, x, y, size, size);
             *              squareColor = !squareColor;
             *      }
             * }
             *
             * foreach (Widget cw in Children)
             *      PropagateExpose (cw, ev);*/

            Gdk.Rectangle rect = child.Allocation;
            GdkWindow.DrawRectangle(this.Style.BackgroundGC(StateType.Normal), true, rect.X, rect.Y, rect.Width, rect.Height);

            Pixbuf sh = Shadow.AddShadow(rect.Width, rect.Height);

            GdkWindow.DrawPixbuf(this.Style.BackgroundGC(StateType.Normal), sh, 0, 0, rect.X - 5, rect.Y - 5, sh.Width, sh.Height, RgbDither.None, 0, 0);
            return(r);
        }
示例#47
0
	void DrawCell (int c, int r, int item)
	{
                if (adapter == null)
                        return;

                Pixbuf image = adapter[item];

		if (image == null)
			return;

#if DORKY_HIGHLIGHT
		Console.WriteLine ("{0} {1} //  {2} {3} // {4}", c, r, mouse_col, mouse_row, highlight_mouse);
		if (c == mouse_col && r == mouse_row && highlight_mouse){
			Pixbuf original = image;
			image = new Pixbuf (original.Colorspace, original.HasAlpha, original.BitsPerSample,
					    original.Width, original.Height);

			original.CopyArea (0, 0, original.Width, original.Height, image, 0, 0);
			image.SaturateAndPixelate (image, 4.0f, false);
		}
#endif

		int x = c * cell_width + margin_left;
		int y =  r * cell_height + margin_top;

		int iw = (int) Math.Min (image.Width * zoom, icon_width);
		int ih = (int) Math.Min (image.Height * zoom, icon_height);

		x += (icon_width - iw) / 2;
		y += (icon_height - ih) / 2;

                // paint over any possible  old selection
                if (!Selection.Get (item)) {
                        for (int i = 0; i < 5; i++) {
                                window.DrawRectangle
                                        (bkgr_gc, false,
                                         x - i - 1, y - i - 1,
                                         iw + i * 2 + 1, ih + i * 2 + 1);
                        }
                }

                if (iw != image.Width || ih != image.Height) {
                        using (Gdk.Pixbuf scaled_image = image.ScaleSimple (iw, ih, InterpType.Tiles)) {
                                Console.WriteLine ("scalesimple pixbuf is at 0x" + scaled_image.Handle.ToInt32().ToString("x"));
                                scaled_image.RenderToDrawable (window, white_gc,
                                                               0, 0, x, y, iw, ih,
                                                               Gdk.RgbDither.None, 0, 0);
                        }
                } else {
                        image.RenderToDrawable (
                                window, white_gc,
                                0, 0, x, y, iw, ih, Gdk.RgbDither.None, 0, 0);
                }


                // then draw any selection
		if (Selection.Get (item)) {
                        window.DrawRectangle (selection_gc, false,
                                              x - 4, y - 4,
                                              iw + 7, ih + 7);
		}
		
	}
	public Photo Create (System.Uri new_uri, System.Uri orig_uri, uint roll_id, out Pixbuf thumbnail)
	{
		Photo photo;
		using (FSpot.ImageFile img = FSpot.ImageFile.Create (orig_uri)) {
			long unix_time = DbUtils.UnixTimeFromDateTime (img.Date);
			string description = img.Description != null  ? img.Description.Split ('\0') [0] : String.Empty;
			string md5_sum = Photo.GenerateMD5 (new_uri);

	 		uint id = (uint) Database.Execute (
				new DbCommand (
					"INSERT INTO photos (time, uri, description, roll_id, default_version_id, rating, md5_sum) "	+
	 				"VALUES (:time, :uri, :description, :roll_id, :default_version_id, :rating, :md5_sum)",
	 				"time", unix_time,
					"uri", new_uri.OriginalString,
	 				"description", description,
					"roll_id", roll_id,
	 				"default_version_id", Photo.OriginalVersionId,
					"rating", "0",
					"md5_sum", md5_sum
				)
			);
	
			photo = new Photo (id, unix_time, new_uri, md5_sum);
			AddToCache (photo);
			photo.Loaded = true;
	
			thumbnail = GenerateThumbnail (new_uri, img);		
			EmitAdded (photo);
		}
		return photo;
	}
	public Photo Create (System.Uri uri, uint roll_id, out Pixbuf thumbnail)
	{
		return Create (uri, uri, roll_id, out thumbnail);
	}
	public Photo Create (string new_path, string orig_path, uint roll_id, out Pixbuf thumbnail)
	{
		return Create (UriUtils.PathToFileUri (new_path), UriUtils.PathToFileUri (orig_path), roll_id, out thumbnail);
	}
	private void ShowStatusImage(string icon, Pixbuf buf){
		if(buf == null){
			Gtk.Widget widget = (Gtk.Widget) this;
    		buf = widget.RenderIcon(icon, Gtk.IconSize.LargeToolbar, null);
		}
		//if(statusImage.Pixbuf != buf)
			statusImage.Pixbuf = buf;
	}
	public override bool Step (out Photo photo, out Pixbuf thumbnail, out int count)
	{
		thumbnail = null;

		if (import_info == null)
			throw new ImportException ("Prepare() was not called");

		if (this.count == import_info.Count)
			throw new ImportException ("Already finished");

		// FIXME Need to get the EXIF info etc.
		ImportInfo info = (ImportInfo)import_info [this.count];
		bool needs_commit = false;
		bool abort = false;
		try {
			string destination = info.OriginalPath;
			if (copy)
				destination = ChooseLocation (info.OriginalPath, directories);
			
			// Don't copy if we are already home
			if (info.OriginalPath == destination) {
				info.DestinationPath = destination;
				photo = store.Create (info.DestinationPath, roll.Id, out thumbnail);
			} else {
				System.IO.File.Copy (info.OriginalPath, destination);
				info.DestinationPath = destination;

				photo = store.Create (info.DestinationPath, info.OriginalPath, roll.Id, out thumbnail);

				try {
					File.SetAttributes (destination, File.GetAttributes (info.DestinationPath) & ~FileAttributes.ReadOnly);
					DateTime create = File.GetCreationTime (info.OriginalPath);
					File.SetCreationTime (info.DestinationPath, create);
					DateTime mod = File.GetLastWriteTime (info.OriginalPath);
					File.SetLastWriteTime (info.DestinationPath, mod);
				} catch (IOException) {
					// we don't want an exception here to be fatal.
				}
			} 

			if (tags != null) {
				foreach (Tag t in tags) {
					photo.AddTag (t);
				}
				needs_commit = true;
			}

			needs_commit |= xmptags.Import (photo, info.DestinationPath, info.OriginalPath);

			if (needs_commit)
				store.Commit(photo);
			
			info.Photo = photo;
		} catch (System.Exception e) {
			System.Console.WriteLine ("Error importing {0}{2}{1}", info.OriginalPath, e.ToString (), Environment.NewLine);
			if (thumbnail != null)
				thumbnail.Dispose ();

			thumbnail = null;
			photo = null;

			HigMessageDialog errordialog = new HigMessageDialog (parent,
									     Gtk.DialogFlags.Modal | Gtk.DialogFlags.DestroyWithParent,
									     Gtk.MessageType.Error,
									     Gtk.ButtonsType.Cancel,
									     Catalog.GetString ("Import error"),
									     String.Format(Catalog.GetString ("Error importing {0}{2}{2}{1}"), info.OriginalPath, e.Message, Environment.NewLine ));
			errordialog.AddButton ("Skip", Gtk.ResponseType.Reject, false);
			ResponseType response = (ResponseType) errordialog.Run ();
			errordialog.Destroy ();
			if (response == ResponseType.Cancel)
				abort = true;
		}

		this.count ++;
		count = this.count;

		return (!abort && count != import_info.Count);
	}
示例#53
0
    private void on_snapshot_mini_done(Pixbuf pixbuf)
    {
        string tempSmallFileName = Path.Combine(Path.GetTempPath(), Constants.PhotoSmallTemp +
                Util.GetMultimediaExtension(Constants.MultimediaItems.PHOTO));

        pixbuf.Save(tempSmallFileName,"jpeg");

        //on windows there are problem using the fileNames that are not on temp
        if(!adding)
            File.Copy(tempSmallFileName, Util.GetPhotoFileName(true, currentPerson.UniqueID), true); //overwrite

        capturer.Close();
        capturer.Dispose();
        capturerWindow.Hide();

        person_win.Show();

        string tempFileName = Path.Combine(Path.GetTempPath(), Constants.PhotoSmallTemp +
            Util.GetMultimediaExtension(Constants.MultimediaItems.PHOTO));
        if(!adding) {
            //on windows there are problem using the fileNames that are not on temp
            string fileName = Util.GetPhotoFileName(true, currentPerson.UniqueID);
            File.Copy(fileName, tempFileName, true);
        }

        if(File.Exists(tempFileName)) {
            Pixbuf pixbuf2 = new Pixbuf (tempFileName); //from a file
            image_photo_mini.Pixbuf = pixbuf2;
        }
    }
示例#54
0
    private void putNonStandardIcons()
    {
        Pixbuf pixbuf;

        //change colors of tests mode

        /*
         * gui for small screens
         */
        //viewport_mode_small.ModifyBg(StateType.Normal, UtilGtk.WHITE);

        UtilGtk.ColorsMenuLabel(label_mode_jumps_small);
        UtilGtk.ColorsMenuLabel(label_mode_jumps_reactive_small);
        UtilGtk.ColorsMenuLabel(label_mode_runs_small);
        UtilGtk.ColorsMenuLabel(label_mode_runs_intervallic_small);
        UtilGtk.ColorsMenuLabel(label_mode_reaction_times_small);
        UtilGtk.ColorsMenuLabel(label_mode_pulses_small);
        UtilGtk.ColorsMenuLabel(label_mode_multi_chronopic_small);

        UtilGtk.ColorsRadio(radio_mode_jumps_small);
        UtilGtk.ColorsRadio(radio_mode_jumps_reactive_small);
        UtilGtk.ColorsRadio(radio_mode_runs_small);
        UtilGtk.ColorsRadio(radio_mode_runs_intervallic_small);
        UtilGtk.ColorsRadio(radio_mode_reaction_times_small);
        UtilGtk.ColorsRadio(radio_mode_pulses_small);
        UtilGtk.ColorsRadio(radio_mode_multi_chronopic_small);

        pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameJumps);
        image_mode_jumps_small.Pixbuf = pixbuf;
        pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameJumpsRJ);
        image_mode_jumps_reactive_small.Pixbuf = pixbuf;
        pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameRuns);
        image_mode_runs_small.Pixbuf = pixbuf;
        pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameRunsInterval);
        image_mode_runs_intervallic_small.Pixbuf = pixbuf;
        pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameReactionTime);
        image_mode_reaction_times_small.Pixbuf = pixbuf;
        pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNamePulse);
        image_mode_pulses_small.Pixbuf = pixbuf;
        pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameMultiChronopic);
        image_mode_multi_chronopic_small.Pixbuf = pixbuf;

        //jumps changes
        UtilGtk.ColorsTestLabel(label_extra_window_radio_jump_free);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_jump_sj);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_jump_sjl);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_jump_cmj);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_jump_cmjl);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_jump_abk);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_jump_dj);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_jump_rocket);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_jump_takeoff);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_jump_more);

        UtilGtk.ColorsRadio(extra_window_radio_jump_free);
        UtilGtk.ColorsRadio(extra_window_radio_jump_sj);
        UtilGtk.ColorsRadio(extra_window_radio_jump_sjl);
        UtilGtk.ColorsRadio(extra_window_radio_jump_cmj);
        UtilGtk.ColorsRadio(extra_window_radio_jump_cmjl);
        UtilGtk.ColorsRadio(extra_window_radio_jump_abk);
        UtilGtk.ColorsRadio(extra_window_radio_jump_dj);
        UtilGtk.ColorsRadio(extra_window_radio_jump_rocket);
        UtilGtk.ColorsRadio(extra_window_radio_jump_takeoff);
        UtilGtk.ColorsRadio(extra_window_radio_jump_more);

        //jumpsRj changes
        UtilGtk.ColorsTestLabel(label_extra_window_radio_jump_rj_j);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_jump_rj_t);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_jump_rj_unlimited);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_jump_rj_hexagon);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_jump_rj_more);

        UtilGtk.ColorsRadio(extra_window_radio_jump_rj_j);
        UtilGtk.ColorsRadio(extra_window_radio_jump_rj_t);
        UtilGtk.ColorsRadio(extra_window_radio_jump_rj_unlimited);
        UtilGtk.ColorsRadio(extra_window_radio_jump_rj_hexagon);
        UtilGtk.ColorsRadio(extra_window_radio_jump_rj_more);

        //runs changes
        UtilGtk.ColorsTestLabel(label_extra_window_radio_run_custom);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_run_20m);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_run_100m);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_run_200m);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_run_400m);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_run_gesell);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_run_20yard);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_run_505);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_run_illinois);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_run_margaria);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_run_shuttle);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_run_zigzag);

        UtilGtk.ColorsRadio(extra_window_radio_run_more);
        UtilGtk.ColorsRadio(extra_window_radio_run_custom);
        UtilGtk.ColorsRadio(extra_window_radio_run_20m);
        UtilGtk.ColorsRadio(extra_window_radio_run_100m);
        UtilGtk.ColorsRadio(extra_window_radio_run_200m);
        UtilGtk.ColorsRadio(extra_window_radio_run_400m);
        UtilGtk.ColorsRadio(extra_window_radio_run_gesell);
        UtilGtk.ColorsRadio(extra_window_radio_run_20yard);
        UtilGtk.ColorsRadio(extra_window_radio_run_505);
        UtilGtk.ColorsRadio(extra_window_radio_run_illinois);
        UtilGtk.ColorsRadio(extra_window_radio_run_margaria);
        UtilGtk.ColorsRadio(extra_window_radio_run_shuttle);
        UtilGtk.ColorsRadio(extra_window_radio_run_zigzag);
        UtilGtk.ColorsRadio(extra_window_radio_run_more);

        //runs intervalchanges
        UtilGtk.ColorsTestLabel(label_extra_window_radio_run_interval_by_laps);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_run_interval_by_time);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_run_interval_unlimited);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_run_interval_mtgug);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_run_interval_more);

        UtilGtk.ColorsRadio(extra_window_radio_run_interval_by_laps);
        UtilGtk.ColorsRadio(extra_window_radio_run_interval_by_time);
        UtilGtk.ColorsRadio(extra_window_radio_run_interval_unlimited);
        UtilGtk.ColorsRadio(extra_window_radio_run_interval_mtgug);
        UtilGtk.ColorsRadio(extra_window_radio_run_interval_more);

        //reaction times changes
        UtilGtk.ColorsTestLabel(label_extra_window_radio_reaction_time);
        UtilGtk.ColorsRadio(extra_window_radio_reaction_time);

        //pulses changes
        UtilGtk.ColorsTestLabel(label_extra_window_radio_pulses_free);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_pulses_custom);
        UtilGtk.ColorsRadio(extra_window_radio_pulses_free);
        UtilGtk.ColorsRadio(extra_window_radio_pulses_custom);

        //multichronopic changes
        UtilGtk.ColorsTestLabel(label_extra_window_radio_multichronopic_start);
        UtilGtk.ColorsTestLabel(label_extra_window_radio_multichronopic_run_analysis);
        UtilGtk.ColorsRadio(extra_window_radio_multichronopic_start);
        UtilGtk.ColorsRadio(extra_window_radio_multichronopic_run_analysis);

        //persons buttons
        pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameNew1);
        image_persons_new_1.Pixbuf = pixbuf;
        pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameNewPlus);
        image_persons_new_plus.Pixbuf = pixbuf;
        pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameOpen1);
        image_persons_open_1.Pixbuf = pixbuf;
        pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameOpenPlus);
        image_persons_open_plus.Pixbuf = pixbuf;

        pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "stock_bell.png");
        image_jump_reactive_bell.Pixbuf = pixbuf;
        image_run_interval_bell.Pixbuf = pixbuf;
        image_encoder_bell.Pixbuf = pixbuf;

        pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "preferences-system.png");
        image_jump_reactive_repair.Pixbuf = pixbuf;
        image_run_interval_repair.Pixbuf = pixbuf;
        image_pulse_repair.Pixbuf = pixbuf;

        pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "stock_delete.png");
        image_person_delete.Pixbuf = pixbuf;
        image_delete_this_test.Pixbuf = pixbuf;
        image_jump_delete.Pixbuf = pixbuf;
        image_jump_reactive_delete.Pixbuf = pixbuf;
        image_run_delete.Pixbuf = pixbuf;
        image_run_interval_delete.Pixbuf = pixbuf;
        image_reaction_time_delete.Pixbuf = pixbuf;
        image_pulse_delete.Pixbuf = pixbuf;
        image_multi_chronopic_delete.Pixbuf = pixbuf;
        image_jump_type_delete_simple.Pixbuf = pixbuf;
        image_jump_type_delete_reactive.Pixbuf = pixbuf;
        image_run_type_delete_simple.Pixbuf = pixbuf;
        image_run_type_delete_intervallic.Pixbuf = pixbuf;

        //zoom icons, done like this because there's one zoom icon created ad-hoc,
        //and is not nice that the other are different for an user theme change

        pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameZoomFitIcon);
        image_jumps_zoom.Pixbuf = pixbuf;
        image_jumps_rj_zoom.Pixbuf = pixbuf;
        image_runs_zoom.Pixbuf = pixbuf;
        image_runs_interval_zoom.Pixbuf = pixbuf;
        image_reaction_times_zoom.Pixbuf = pixbuf;
        image_pulses_zoom.Pixbuf = pixbuf;
        image_multi_chronopic_zoom.Pixbuf = pixbuf;

        //encoder
        pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameZoomInIcon);
        image_encoder_analyze_zoom.Pixbuf = pixbuf;
        pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "gpm-statistics.png");
        image_encoder_analyze_stats.Pixbuf = pixbuf;
        pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "stock_delete.png");
        image_encoder_signal_delete.Pixbuf = pixbuf;
    }
示例#55
0
文件: MainWindow.cs 项目: pxqr/nanon
    void DrawMatrix(Matrix matrix)
    {
        if (matrix == null)
            return;

        var buffer = ToBitmap(matrix, rowWiseView);
        var pb = new Pixbuf(buffer, false, 8,
                               matrix.Width,
                               matrix.Height, matrix.Width * 3);
        matrixImage.Pixbuf = pb.ScaleSimple(300, 300, InterpType.Nearest);
    }
示例#56
0
    private void eventExecutePutNonStandardIcons()
    {
        Pixbuf pixbuf;
        pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "stock_bell_green.png");
        event_execute_image_jump_reactive_tf_good.Pixbuf = pixbuf;
        event_execute_image_jump_reactive_tc_good.Pixbuf = pixbuf;
        event_execute_image_jump_reactive_tf_tc_good.Pixbuf = pixbuf;
        event_execute_image_run_interval_time_good.Pixbuf = pixbuf;

        pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "stock_bell_red.png");
        event_execute_image_jump_reactive_tf_bad.Pixbuf = pixbuf;
        event_execute_image_jump_reactive_tc_bad.Pixbuf = pixbuf;
        event_execute_image_jump_reactive_tf_tc_bad.Pixbuf = pixbuf;
        event_execute_image_run_interval_time_bad.Pixbuf = pixbuf;
    }
示例#57
0
	static IconList ()
	{
		LoadingImage = new Pixbuf (null, "loading.png");
	}
	public Photo Create (string path, uint roll_id, out Pixbuf thumbnail)
	{
		return Create (path, path, roll_id, out thumbnail);
	}
示例#59
0
    private void initialize()
    {
        notebook_main.CurrentPage = 0;
        radio_by_persons.Active = true;

        Pixbuf pixbuf;

        pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "auto-by-persons.png");
        image_auto_by_persons.Pixbuf = pixbuf;
        pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "auto-by-tests.png");
        image_auto_by_tests.Pixbuf = pixbuf;
        pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "auto-by-series.png");
        image_auto_by_sets.Pixbuf = pixbuf;

        image_auto_by_tests.Sensitive = false;
        image_auto_by_sets.Sensitive = false;
        label_persons_info.Visible = true;
        label_tests_info.Visible = false;
        label_series_info.Visible = false;

        jumpTypes = SqliteJumpType.SelectJumpTypes(false, "", "", false); //without alljumpsname, without filter, not only name

        createTreeviewLoad();
        fillTreeviewLoad();

        createComboSelect();
        createTreeviewSeries();
    }
示例#60
0
    //changes the image about the text on the bottom left of main screen
    private void changeTestImage(string eventTypeString, string eventName, string fileNameString)
    {
        label_image_test.Text = "<b>" + eventName + "</b>";
        label_image_test.UseMarkup = true;

        Pixbuf pixbuf; //main image
        Pixbuf pixbufZoom; //icon of zoom image (if shown can have two different images)

        switch (fileNameString) {
            case "LOGO":
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameLogo);
                button_image_test_zoom.Hide();
            break;
            case "":
                pixbuf = new Pixbuf (null, Util.GetImagePath(true) + "no_image.png");
                button_image_test_zoom.Hide();
            break;
            default:
                pixbuf = new Pixbuf (null, Util.GetImagePath(true) + fileNameString);

                //button image test zoom will have a different image depending on if there's text
                //future: change tooltip also
                if(eventTypeString != "" && eventName != "" && eventTypeHasLongDescription (eventTypeString, eventName))
                    pixbufZoom = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameZoomInWithTextIcon);
                else
                    pixbufZoom = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameZoomInIcon);

                image_test_zoom.Pixbuf = pixbufZoom;
                button_image_test_zoom.Show();
            break;
        }
        image_test.Pixbuf = pixbuf;
    }