CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Wince setbitmap

  1. #1
    Join Date
    Feb 2004
    Posts
    1

    Wince setbitmap

    I have problem with showing bitmap in static picture control.

    i cant debug it on wince - so i tested on winxp and just moved code.

    i have static control pic - with default bitmap.
    By clicking on button it should change to another one.
    on initDlg
    i do

    CBitmap a=LoadBitmap(IDB_BITMAP1);

    and in the button function onClick i do

    m_pic.SetBitmap(a);

    m_pic - is control variable for picture control created by ClassWizard
    ////////// in vc++6 its ok
    when i compile this in Embedded Visual C++
    it runs as i was told without showing bitmaps


    Can anyone help me with this ?

  2. #2
    Join Date
    Sep 1999
    Location
    France
    Posts
    393
    //Ugly but works

    CStatic m_stat; //With notify check in the resources of the static

    UINT uibmp = IDB_BITMAP2;
    CBitmap bmp;
    void CBMPChangeDlg::OnClick()
    {
    bmp.DeleteObject();
    bmp.LoadBitmap(uibmp);
    m_stat.SetBitmap(bmp);
    uibmp=(uibmp==IDB_BITMAP2)?IDB_BITMAP1:IDB_BITMAP2;
    }

  3. #3
    Join Date
    Jan 2002
    Location
    United Kingdom
    Posts
    491
    Hi,

    After changing the bitmap it might be possible to run the function called UpdateData to update the dialogs controls with the new values stored within the variables?

    I hope that this helps!

    Best Regards,
    Lea Hayes

  4. #4
    Join Date
    Nov 2002
    Location
    Israel
    Posts
    182
    If all previous answers did not help, try to remove your static picture control and draw the bitmaps directly on the window HDC. This way always works. Especialy on WinCE. If it's difficult for you, on this site you can find CDIBLiteSection class (WinCE section if I'm not mistaken).
    Good luck

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured