本文整理汇总了C#中Gtk.Image类的典型用法代码示例。如果您正苦于以下问题:C# Image类的具体用法?C# Image怎么用?C# Image使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Image类属于Gtk命名空间,在下文中一共展示了Image类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BDialog
public BDialog(string aName, Gtk.Window aParent, string aText)
: base(aName, aParent, Gtk.DialogFlags.NoSeparator)
{
// setup dialog
this.Modal = true;
this.BorderWidth = 6;
this.HasSeparator = false;
this.Resizable = false;
this.VBox.Spacing=12;
// graphic items
hbox = new Gtk.HBox();
Gtk.VBox labelBox = new VBox();
label = new Gtk.Label();
image = new Gtk.Image();
hbox.Spacing=12;
hbox.BorderWidth=6;
this.VBox.Add(hbox);
// set-up image
image.Yalign=0.0F;
hbox.Add(image);
// set-up label
label.Yalign=0.0F;
label.Xalign=0.0F;
label.UseMarkup=true;
label.Wrap=true;
label.Markup=aText;
// add to dialog
labelBox.Add(label);
hbox.Add(labelBox);
}
示例2: WebcamVisionStereoGtk
/// <summary>
/// constructor
/// </summary>
/// <param name="host">host name or IP address</param>
/// <param name="port_number_left">port number for the left camera</param>
/// <param name="port_number_right">port number for the right camera</param>
/// <param name="broadcast_port">port number on which to broadcast stereo feature data to other applications</param>
/// <param name="fps">ideal frames per second</param>
public WebcamVisionStereoGtk(string left_camera_device,
string right_camera_device,
int broadcast_port,
float fps) : base (left_camera_device, right_camera_device, broadcast_port, fps)
{
display_image = new Gtk.Image[2];
}
示例3: ArtworkPopup
public ArtworkPopup() : base(Gtk.WindowType.Popup)
{
VBox vbox = new VBox();
Add(vbox);
Decorated = false;
BorderWidth = 6;
SetPosition(WindowPosition.CenterAlways);
image = new Gtk.Image();
label = new Label(String.Empty);
label.CanFocus = false;
label.Wrap = true;
label.ModifyBg(StateType.Normal, new Color(0, 0, 0));
label.ModifyFg(StateType.Normal, new Color(160, 160, 160));
ModifyBg(StateType.Normal, new Color(0, 0, 0));
ModifyFg(StateType.Normal, new Color(160, 160, 160));
vbox.PackStart(image, true, true, 0);
vbox.PackStart(label, false, false, 0);
vbox.Spacing = 6;
vbox.ShowAll();
}
示例4: AppletWidget
public AppletWidget(AppletStyle style, int? size)
{
// Tooltips
Tooltips = new Tooltips();
Tooltips.SetTip(this, Catalog.GetString("Deskop Drapes, click to switch wallpaper"), null);
if (style == AppletStyle.APPLET_PANEL) {
height = 22; // for now this always 22 since the gnome-panel lies to us, what an asshole
} else {
height = 22;
}
// Create the icon
Icon = new Image(Theme.LoadIcon("drapes", height, Gtk.IconLookupFlags.UseBuiltin));
Add(Icon);
// Set enabled status
Enabled = DrapesApp.Cfg.ShuffleEnabled;
// Keep track of what kind of applet we are
// if we are a tray icon, then register a notification area widget
this.AppletStyle = style;
if (this.AppletStyle == AppletStyle.APPLET_TRAY)
CreateNotifyIcon();
// What shall we do
ButtonPressEvent += ButtonPress;
// Show the tray
ShowAll();
}
示例5: WelcomePageBarButton
public WelcomePageBarButton (string title, string href, string iconResource = null)
{
FontFamily = Platform.IsMac ? Styles.WelcomeScreen.FontFamilyMac : Styles.WelcomeScreen.FontFamilyWindows;
HoverColor = Styles.WelcomeScreen.Links.HoverColor;
Color = Styles.WelcomeScreen.Links.Color;
FontSize = Styles.WelcomeScreen.Links.FontSize;
VisibleWindow = false;
this.Text = GettextCatalog.GetString (title);
this.actionLink = href;
if (!string.IsNullOrEmpty (iconResource)) {
imageHover = Gdk.Pixbuf.LoadFromResource (iconResource);
imageNormal = ImageService.MakeTransparent (imageHover, 0.7);
}
HBox box = new HBox ();
box.Spacing = Styles.WelcomeScreen.Links.IconTextSpacing;
image = new Image ();
label = new Label ();
box.PackStart (image, false, false, 0);
if (imageNormal == null)
image.NoShowAll = true;
box.PackStart (label, false, false, 0);
box.ShowAll ();
Add (box);
Update ();
Events |= (Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask | Gdk.EventMask.ButtonReleaseMask);
}
示例6: Tile
public Tile (Hit hit, Query query) : base ()
{
base.AboveChild = true;
base.AppPaintable = true;
base.CanFocus = true;
this.hit = hit;
this.query = query;
this.timestamp = hit.Timestamp;
this.score = hit.Score;
Gtk.Drag.SourceSet (this, Gdk.ModifierType.Button1Mask, targets,
Gdk.DragAction.Copy | Gdk.DragAction.Move);
int pad = (int)StyleGetProperty ("focus-line-width") + (int)StyleGetProperty ("focus-padding") + 1;
hbox = new Gtk.HBox (false, 5);
hbox.BorderWidth = (uint)(pad + Style.Xthickness);
hbox.Show ();
icon = new Gtk.Image ();
icon.Show ();
hbox.PackStart (icon, false, false, 0);
Add (hbox);
}
示例7: TaskManagerGui
/// <summary>
/// Initialization, takes the Addin this gui is attached to.
/// </summary>
public TaskManagerGui(TaskManagerNoteAddin addin)
{
this.addin = addin;
utils = new TaskNoteUtilities (addin.Buffer);
var duedateImage = new Gtk.Image(null, "Tomboy.TaskManager.Icons.duedate-icon22.png");
add_duedate.Image = duedateImage;
var priorityImage = new Gtk.Image(null, "Tomboy.TaskManager.Icons.priority-icon22.png");
add_priority.Image = priorityImage;
task_menu.Add (add_duedate);
task_menu.Add (add_priority);
task_menu.Add (show_priority);
if (Tomboy.Debugging) {
Gtk.MenuItem print_structure = new Gtk.MenuItem (Catalog.GetString ("Print Structure"));
print_structure.Activated += OnPrintStructureActivated;
task_menu.Add (print_structure);
}
var todoImage = new Gtk.Image(null, "Tomboy.TaskManager.Icons.todo-icon24.png");
menu_tool_button = new Gtk.MenuToolButton (todoImage, null);
menu_tool_button.TooltipText = Catalog.GetString ("Add a new TaskList");
menu_tool_button.ArrowTooltipText = Catalog.GetString ("Set TaskList properties");
menu_tool_button.Menu = task_menu;
task_menu.ShowAll ();
menu_tool_button.Show ();
addin.AddToolItem (menu_tool_button, -1);
}
示例8: CreateButton
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;
}
示例9: ModelElementTypeViewer
public ModelElementTypeViewer(IBroadcaster hub)
{
_hub = hub;
base.PackStart(new Gtk.Label("Model Element type:"), false, false, 2);
_lblType = new Gtk.Label();
base.PackStart(_lblType, false, false, 2);
base.PackStart(new Gtk.Label(String.Empty), true, true, 0);
// "Up" button
Gtk.Image image = new Gtk.Image();
image.Stock = Gtk.Stock.GoUp;
_btnGoUp = new Gtk.Button();
_btnGoUp.Add(image);
_btnGoUp.Relief = Gtk.ReliefStyle.None;
_btnGoUp.Clicked += new EventHandler(OnGoUpButtonClicked);
_btnGoUp.Sensitive = false;
base.PackStart(_btnGoUp, false, false, 0);
// "Delete" button
image = new Gtk.Image();
image.Stock = Gtk.Stock.Delete;
Gtk.Button btnDelete = new Gtk.Button();
btnDelete.Add(image);
btnDelete.Relief = Gtk.ReliefStyle.None;
btnDelete.Clicked += new EventHandler(OnDeleteButtonClicked);
btnDelete.Sensitive = true;
base.PackStart(btnDelete, false, false, 0);
}
示例10: PlayPauseButton
public PlayPauseButton(string playXPM, string pauseXPM)
{
_paused = true;
_playImage = new Pixbuf(playXPM);
_pauseImage = new Pixbuf(pauseXPM);
_image = new Gtk.Image();
_image.Pixbuf = _playImage;
Add(_image);
_image.Show();
this.ButtonPressEvent+= delegate(object o, ButtonPressEventArgs args) {
if (_paused)
_image.Pixbuf = _pauseImage;
else
_image.Pixbuf = _playImage;
_paused = !_paused;
if (Clicked != null)
Clicked(this, new PlayPauseButtonEventArgs(){ IsPaused = _paused });
};
this.WidthRequest = _image.Pixbuf.Width;
}
示例11: TabLabel
public TabLabel (Label label, Gtk.Image icon) : base (false, 0)
{
this.title = label;
this.icon = icon;
icon.Xpad = 2;
EventBox eventBox = new EventBox ();
eventBox.BorderWidth = 0;
eventBox.VisibleWindow = false;
eventBox.Add (icon);
this.PackStart (eventBox, false, true, 0);
titleBox = new EventBox ();
titleBox.VisibleWindow = false;
titleBox.Add (title);
this.PackStart (titleBox, true, true, 0);
Gtk.Rc.ParseString ("style \"MonoDevelop.TabLabel.CloseButton\" {\n GtkButton::inner-border = {0,0,0,0}\n }\n");
Gtk.Rc.ParseString ("widget \"*.MonoDevelop.TabLabel.CloseButton\" style \"MonoDevelop.TabLabel.CloseButton\"\n");
Button button = new Button ();
button.CanDefault = false;
var closeIcon = new Xwt.ImageView (closeImage).ToGtkWidget ();
button.Image = closeIcon;
button.Relief = ReliefStyle.None;
button.BorderWidth = 0;
button.Clicked += new EventHandler(ButtonClicked);
button.Name = "MonoDevelop.TabLabel.CloseButton";
this.PackStart (button, false, true, 0);
this.ClearFlag (WidgetFlags.CanFocus);
this.BorderWidth = 0;
this.ShowAll ();
}
示例12: ArtworkPopup
public ArtworkPopup()
: base(Gtk.WindowType.Popup)
{
VBox vbox = new VBox();
Add(vbox);
Decorated = false;
BorderWidth = 6;
SetPosition(WindowPosition.CenterAlways);
image = new Gtk.Image();
label = new Label(String.Empty);
label.CanFocus = false;
label.Wrap = true;
var bg_color = new RGBA ();
bg_color.Red = bg_color.Green = bg_color.Blue = 0;
var fg_color = new RGBA ();
fg_color.Red = bg_color.Green = bg_color.Blue = 160.0 / 255;
label.OverrideBackgroundColor (StateFlags.Normal, bg_color);
label.OverrideColor (StateFlags.Normal, fg_color);
OverrideBackgroundColor (StateFlags.Normal, bg_color);
OverrideColor (StateFlags.Normal, fg_color);
vbox.PackStart(image, true, true, 0);
vbox.PackStart(label, false, false, 0);
vbox.Spacing = 6;
vbox.ShowAll();
}
示例13: NotificationMessage
public NotificationMessage (string t, string m) : base (false, 5)
{
this.Style = style;
BorderWidth = 5;
icon = new Image (Stock.DialogInfo, IconSize.Dialog);
this.PackStart (icon, false, true, 5);
VBox vbox = new VBox (false, 5);
this.PackStart (vbox, true, true, 0);
title = new Label ();
title.SetAlignment (0.0f, 0.5f);
this.Title = t;
vbox.PackStart (title, false, true, 0);
message = new Label ();
message.LineWrap = true;
message.SetSizeRequest (500, -1); // ugh, no way to sanely reflow a gtk label
message.SetAlignment (0.0f, 0.0f);
this.Message = m;
vbox.PackStart (message, true, true, 0);
action_box = new HBox (false, 3);
Button hide_button = new Button (Catalog.GetString ("Hide"));
hide_button.Clicked += OnHideClicked;
action_box.PackEnd (hide_button, false, true, 0);
Alignment action_align = new Alignment (1.0f, 0.5f, 0.0f, 0.0f);
action_align.Add (action_box);
vbox.PackStart (action_align, false, true, 0);
}
示例14: Tab
public Tab (string tabName)
{
if (tabName == null)
throw new ArgumentNullException ("tabName");
Label label = new Label (tabName);
label.Justify = Justification.Left;
label.UseUnderline = false;
Gtk.Image image = new Gtk.Image (Stock.Close, IconSize.Menu);
image.Xalign = 0.5f;
image.Yalign = 0.5f;
Button button = new Button ();
button.HeightRequest = 20;
button.WidthRequest = 20;
button.Relief = ReliefStyle.None;
button.CanFocus = false;
button.Clicked += delegate {
if (CloseButtonClicked != null)
CloseButtonClicked (this, EventArgs.Empty);
};
button.Add (image);
this.PackStart (label, true, true, 0);
this.PackEnd (button, false, false, 0);
this.ShowAll ();
}
示例15: ImageWindow
public ImageWindow(string src)
: base(src)
{
Decorated = false;
KeepAbove = true;
Resize (640, 240);
Move (100, 100);
//Opacity = 1.0;
pixbuf = new Pixbuf (src);
Gtk.Image image = new Gtk.Image ();
image.Pixbuf = pixbuf;
EventBox box = new EventBox ();
box.Add (image);
box.ButtonPressEvent += new ButtonPressEventHandler (WindowController.OnButtonDragPress);
box.ExposeEvent += HandleMyWinExposeEvent;
Add (box);
WindowController.HandleMyWinScreenChanged(this, null);
WindowController.SetWindowShapeFromPixbuf (this, image.Pixbuf);
DestroyEvent += new DestroyEventHandler (delegate(object o, DestroyEventArgs args) {
if(cr!=null){
((IDisposable)cr).Dispose();
}
});
ShowAll();
}