当前位置: 首页>>代码示例>>C#>>正文


C# Pixbuf类代码示例

本文整理汇总了C#中Pixbuf的典型用法代码示例。如果您正苦于以下问题:C# Pixbuf类的具体用法?C# Pixbuf怎么用?C# Pixbuf使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Pixbuf类属于命名空间,在下文中一共展示了Pixbuf类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ColorAdjust

    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;
    }
开发者ID:iainlane,项目名称:f-spot,代码行数:7,代码来源:PixbufUtils.cs

示例2: MainWindow

	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) 
		{
			
		}
	}
开发者ID:Zelxin,项目名称:RPiKeg,代码行数:30,代码来源:MainWindow.cs

示例3: LoadScaled

	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;
	}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:8,代码来源:JpegUtils.cs

示例4: Fit

	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);
	}
开发者ID:ArsenShnurkov,项目名称:beagle-1,代码行数:10,代码来源:PixbufUtils.cs

示例5: CreateEffect

	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;
	}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:55,代码来源:Shadow.cs

示例6: OnShown

    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();
    }
开发者ID:pzsysa,项目名称:gtk-sharp-forms,代码行数:12,代码来源:MainWindow.cs

示例7: AddThumbnail

	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 ();
	}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:14,代码来源:ThumbnailCache.cs

示例8: Serialize

	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;
	}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:15,代码来源:TagStore.cs

示例9: About

    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;
    }
开发者ID:dineshkummarc,项目名称:chronojump,代码行数:48,代码来源:about.cs

示例10: Serialize

	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;
	}
开发者ID:guadalinex-archive,项目名称:guadalinex-v6,代码行数:16,代码来源:TagStore.cs

示例11: GetThumbnailForPath

	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;
	}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:19,代码来源:ThumbnailCache.cs

示例12: RatingWidget

    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;
    }
开发者ID:MonoBrasil,项目名称:historico,代码行数:19,代码来源:RatingWidget.cs

示例13: Blur

    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 ();
    }
开发者ID:GNOME,项目名称:f-spot,代码行数:19,代码来源:PixbufUtils.cs

示例14: SplashWindow

    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;
    }
开发者ID:dineshkummarc,项目名称:chronojump,代码行数:20,代码来源:splash.cs

示例15: DialogImageTest

    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;
    }
开发者ID:dineshkummarc,项目名称:chronojump,代码行数:22,代码来源:dialogImageTest.cs


注:本文中的Pixbuf类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。