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


C# Window.SetIconFromFile方法代码示例

本文整理汇总了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;
		}
开发者ID:liberostelios,项目名称:gtk-sharp,代码行数:8,代码来源:GExceptionTest.cs

示例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();
        }
开发者ID:Bram77,项目名称:xbmcontrol-evo,代码行数:39,代码来源:MediaInfo.cs

示例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);
            }
        }
开发者ID:Bram77,项目名称:xbmcontrol-evo,代码行数:37,代码来源:Controls.cs


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