本文整理汇总了C#中Pixbuf类的典型用法代码示例。如果您正苦于以下问题:C# Pixbuf类的具体用法?C# Pixbuf怎么用?C# Pixbuf使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Pixbuf类属于命名空间,在下文中一共展示了Pixbuf类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: Create
public Photo Create (System.Uri uri, uint roll_id, out Pixbuf thumbnail)
{
return Create (uri, uri, roll_id, out thumbnail);
}
开发者ID:guadalinex-archive,项目名称:guadalinex-v6,代码行数:4,代码来源:PhotoStore.cs
示例17: Step
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);
}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:79,代码来源:FileImportBackend.cs
示例18: eventExecutePutNonStandardIcons
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;
}
开发者ID:dineshkummarc,项目名称:chronojump,代码行数:15,代码来源:eventExecute.cs
示例19: IconList
static IconList ()
{
LoadingImage = new Pixbuf (null, "loading.png");
}
开发者ID:emtees,项目名称:old-code,代码行数:4,代码来源:IconList.cs
示例20: changeTestImage
//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;
}
开发者ID:dineshkummarc,项目名称:chronojump,代码行数:34,代码来源:chronojump.cs
注:本文中的Pixbuf类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论