Plugin Icon in Configuration Dialog (1 Viewer)

k3ks

New Member
July 10, 2010
3
0
Hi,
I'm fairly new to MP plugin development and I just want to try out some things before I start to get real. I've been trying to add an icon for my plugin that is shown in the plugin-tab of MP Configuration. I assumed it should be something like this:

namespace MediaPortal.Plugins.MyPlugin.MainGUI
{
[PluginIcons("MediaPortal.Plugins.MyPlugin.Resources.Images.myPlugin.png",
"MediaPortal.Plugins.MyPlugin.Resources.Images.myPlugin_fade.png")]
public class MainWindow : GUIWindow, ISetupForm
{
...

I've included the resources in the right places, no compiling errors but the icon just doesn't show up. What do I have to do? Is this even the right way?

Thanks for your help

k3ks
 

jameson_uk

Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    This looks about right (music plugin has)
    Code:
    [PluginIcons("WindowPlugins.GUIMusic.Music.gif", "WindowPlugins.GUIMusic.MusicDisabled.gif")]

    which makes me think that it might not like png graphics. I would try that first as on first scan the code looks ok
     

    k3ks

    New Member
    July 10, 2010
    3
    0
    AW: Plugin Icon in Configuration Dialog

    Ok, in debug mode I get this message:
    "A first chance exception of type 'System.ArgumentException' has occured in System.Drawing.dll". Where's my mistake? the pngs are in the right place. I've tried different filetypes and played with the namespaces.
    Any idea?
     

    SilentException

    Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    The images should be ADDED to project and marked as embedded resource. Also, you must watch for namespaces in the image names. For example:

    CSPROJ:
    <EmbeddedResource Include="Config\Images\SubCentral_Icon_Enabled.png">

    Configuration class:
    [PluginIcons("SubCentral.Config.Images.SubCentral_Icon_Enabled.png", ...)]
     

    k3ks

    New Member
    July 10, 2010
    3
    0
    AW: Plugin Icon in Configuration Dialog

    Hey thanks,
    the mistake was that the pics were not embedded resources. Now it works fine.
    bye:D
     

    crawshaws

    Portal Member
    October 1, 2010
    11
    0
    Home Country
    United Kingdom United Kingdom
    Hey sorry to hijack this thread, but i cannot even get this far....

    I add in the [PluginIcons] attribute and it throws an error even before compile stating that the type of namespace "PluginIcons" cannot be found....

    What references am i missing?

    Thanks
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,755
    7,200
    Sydney
    Home Country
    Australia Australia
    I add in the [PluginIcons] attribute and it throws an error even before compile stating that the type of namespace "PluginIcons" cannot be found....

    What references am i missing?
    using MediaPortal.Configuration;
     

    Users who are viewing this thread

    Top Bottom