How to set the image of an image? (1 Viewer)

jmbillings

MP Donator
  • Premium Supporter
  • June 9, 2008
    128
    20
    Ely
    Home Country
    United Kingdom United Kingdom
    I'm sure this is stupidly simple but I couldn't spot it in the wiki. Right now, my plugin is basically an image. Assuming in my code I have an image/bitmap object, how do I display it in the image control? I don't see any obvious method or property. There's a "setItems" but this needs an int.

    Any pointers? I can also see "setFileName" and as a workaround I could save my image out to a file in temp and then point to the file, but that seems wrong...
     

    jmbillings

    MP Donator
  • Premium Supporter
  • June 9, 2008
    128
    20
    Ely
    Home Country
    United Kingdom United Kingdom
    Hm, ok - saving image to a file and then populating that into the filename does work. I guess it's good for now :)
     

    doskabouter

    Development Group
  • Team MediaPortal
  • September 27, 2009
    4,638
    3,062
    Nuenen
    Home Country
    Netherlands Netherlands
    You can also have a control in your skin like
    Code:
    	<control>
    	  <description>Placeholder</description>
    	  <type>image</type>
    	  <id>123456</id>
    	  <width>960</width>
    	  <height>720</height>
    	</control>

    and in code:
    Code:
    			GUIControl cntrol = GetControl(123456);
    			if (cntrol != null)
    			{
    				Point loc= new Point(cntrol.XPosition, cntrol.YPosition);
    				int w = cntrol.Width;
    				int h = cntrol.Height;
    				//image drawing here at loc, w,h
    			}
     

    Users who are viewing this thread

    Top Bottom