本文整理汇总了C#中Gtk.Window.SetIconFromFile方法的典型用法代码示例。如果您正苦于以下问题:C# Window.SetIconFromFile方法的具体用法?C# Window.SetIconFromFile怎么用?C# Window.SetIconFromFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Window
的用法示例。
在下文中一共展示了Window.SetIconFromFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public static int Main (string[] args)
{
Application.Init ();
Gtk.Window win = new Gtk.Window ("GException");
win.SetIconFromFile ("this.filename.does.not.exist");
// Notreached, GException should throw on above call.
return 0;
}
示例2: ShowSongInfoPopup
public void ShowSongInfoPopup(string filepath)
{
string sDuration = _parent.SecondsToHumanTime(_parent.oXbmc.Media.GetMusicTagByFilepath(filepath, "duration"));
string songInfo = "\n\nartist: " + _parent.oXbmc.Media.GetMusicTagByFilepath(filepath, "artist");
songInfo += "\ntitle: " + _parent.oXbmc.Media.GetMusicTagByFilepath(filepath, "title");
songInfo += "\nalbum: " + _parent.oXbmc.Media.GetMusicTagByFilepath(filepath, "album");
songInfo += "\ngenre: " + _parent.oXbmc.Media.GetMusicTagByFilepath(filepath, "genre");
songInfo += "\nduration: " + sDuration;
Gtk.Window wSongInfo = new Gtk.Window("Song Info");
wSongInfo.SetPosition(WindowPosition.CenterAlways);
wSongInfo.SetIconFromFile("images/icon.png");
Pango.FontDescription fd = Pango.FontDescription.FromString("Verdana Bold 9");
/*
string thumbLocation = _parent.oXbmc.Media.GetFileThumbnailLocation(filepath);
if (thumbLocation != null)
{
MemoryStream msThumbnail = _parent.oXbmc.Media.FileDownload(thumbLocation);
if (msThumbnail != null)
wSongInfo.Add(new Gtk.Image(new Gdk.Pixbuf(msThumbnail)));
}
*/
Label lArtist = new Label(songInfo);
lArtist.ModifyFont(fd);
lArtist.Xpad = 20;
lArtist.Ypad = 20;
wSongInfo.Add(lArtist);
//Gtk.Image iCoverart = new Gtk.Image(new Gdk.Pixbuf(_parent.oXbmc.Media.GetFileThumbnailLocation(filepath)));
//wSongInfo.Add(iCoverart);
wSongInfo.ShowAll();
}
示例3: GetFileInfo
public void GetFileInfo()
{
TreeModel selectedModel;
TreeIter selectedIter = new TreeIter();
if (_parent._tvShares.Selection.GetSelected(out selectedModel, out selectedIter))
{
string filepath = selectedModel.GetValue(selectedIter, 2).ToString();
string sDuration = _parent.oHelper.SecondsToHumanTime(_parent.oXbmc.Media.GetMusicTagByFilepath(filepath, "duration"));
string songInfo = "artist: " + _parent.oXbmc.Media.GetMusicTagByFilepath(filepath, "artist");
songInfo += "\ntitle: " + _parent.oXbmc.Media.GetMusicTagByFilepath(filepath, "title");
songInfo += "\nalbum: " + _parent.oXbmc.Media.GetMusicTagByFilepath(filepath, "album");
songInfo += "\ngenre: " + _parent.oXbmc.Media.GetMusicTagByFilepath(filepath, "genre");
songInfo += "\nduration: " + sDuration;
Window wSongInfo = new Window("Song Info");
wSongInfo.SetPosition(WindowPosition.CenterAlways);
wSongInfo.SetIconFromFile("images/icon.png");
Pango.FontDescription fd = Pango.FontDescription.FromString("Verdana Bold 9");
Label lArtist = new Label(songInfo);
lArtist.ModifyFont(fd);
lArtist.Xpad = 20;
lArtist.Ypad = 20;
wSongInfo.Add(lArtist);
//Gtk.Image iCoverart = new Gtk.Image(new Gdk.Pixbuf(_parent.oXbmc.Media.GetFileThumbnailLocation(filepath)));
//wSongInfo.Add(iCoverart);
wSongInfo.ShowAll();
//_parent.Messagebox(songInfo);
}
}