本文整理汇总了C#中Gtk.Image.Hide方法的典型用法代码示例。如果您正苦于以下问题:C# Image.Hide方法的具体用法?C# Image.Hide怎么用?C# Image.Hide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Image
的用法示例。
在下文中一共展示了Image.Hide方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawImageInWindow
/// <summary>
/// Placeholder method to draw the existing filename inside the window.
///
/// Currently, we are using a method where we create a new HBox and stuff
/// the image widget there and remove the old widget, which is technically overkill
/// but since this behaves somewhat like a double buffer, it should make the overall
/// experience smoother.
/// </summary>
/// <param name="filename">
/// A <see cref="System.String"/>
/// </param>
void DrawImageInWindow(string filename)
{
// Create the new image widget and draw it being hidden
try {
Log.Debug("Drawing image now");
Gtk.Image drawTarget = new Gtk.Image(filename);
drawTarget.Hide();
foreach(Widget child in hbox3.Children)
{
// remove all existing children
hbox3.Remove(child);
child.Dispose();
}
drawTarget.Show();
hbox3.PackStart(drawTarget, true, true, 0);
} catch (Exception ex) {
Log.Error("Something broke in DrawImageInWindow - " + ex.Message);
}
}