INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: GetSkinInfo color conversion and other questions  (Read 1501 times)

pbair

  • Recent member
  • *
  • Posts: 33
GetSkinInfo color conversion and other questions
« on: October 25, 2009, 08:52:45 am »

I'm having trouble translating the 3 lines of code between '////////' below to VB.net.  Any help would be appreciated. 

GetSkinInfo("Tree", "TextColor");
GetSkinInfo("StatusBar", "BackColor");

C# Example: translating a MC Color into a Color Object:
Code: [Select]
private Color getColor(String strItem, String strAttribute)
{
    int intColor;
    int intR;
    int intG;
    int intB;

    intColor = mcRef.GetSkinInfo ( strItem, strAttribute );

    if (intColor != -1)
    {

//////////////////  VB TRANSLATION ? //////////////////////
   
        intR = intColor & 255;
        intG = (intColor >> 8) & 255;
        intB = (intColor >> 16) & 255;

///////////////////////////////////////////////////////////////

        return Color.FromArgb ( intR, intG, intB );

    }
    else
    {
        // Return a default Color if not found!

        return Color.LightGray;
    }
}
...


     Panel.BackColor = getColor ( "Tree", "BackColor" );

A quick explanation how the hex color value in a main.xml is converted to the resulting integer of GetSkinInfo may be helpful, too.

Also, how is it possible to have GetSkinInfo return an image filename, or any skin item value that is not a color?  Doesn't seem so if the return value of GetSkinInfo is an integer.
Logged
Pages: [1]   Go Up