Answered Using code to change background in SWE

  • Thursday, August 16, 2012 10:52 AM
     
      Has Code

    Hi,

    I am developing application using SWE and WEC7

    I have a simple TextBox control on my form, and  i  want to change background color or background image

    currently i am using this code ->

    IXRSolidColorBrush *myBrush;
    IXRApplicationPtr app;
    GetXRApplicationInstance(&app);
    app->CreateObject(IID_IXRSolidColorBrush,&myBrush);
    myBrush->SetColor(RGB(255,0,0));
    hr = m_pILResult->SetBackground(myBrush);
    IXRImageBrushPtr pImageBrush;
    IXRBitmapImagePtr pDinerBitmap;
    app->CreateObject(&pImageBrush);
    app->CreateObject(&pDinerBitmap);
    
    hr = pDinerBitmap->SetUriSource(L"07.png");
    hr = pImageBrush->SetImageSource(pDinerBitmap);
    hr = m_pResult->SetBackground(pImageBrush); 

    I got most of this code from MS examples but it dosnt update background, can someone help me or just point me in right direction to change background?

    Best regards,

    Luka

All Replies

  • Thursday, August 16, 2012 11:57 AM
     
     Answered

    I figured it

    the problem is with myBrush->SetColor(RGB(255,0,0)); as it should be myBrush->SetColor(RGBA(0,0,255,255));

    • Marked As Answer by LukecPivk Thursday, August 16, 2012 11:57 AM
    •