CStatic中SetBitmap函数到底有什么用?
设置一个位图但就是不能显示,到底SetBitmap函数是做什么的?

解决方案 »

  1.   

    当然有用,不能说你用错了,但是你对CSTATIC的属性设置有不恰当的地方,我以前碰倒过这类问题,是属性设置问题,具体想不起来了。
      

  2.   

    In a Microsoft Foundation Class (MFC) Libraried application for Windows, it is occasionally useful to be able to display a bitmap larger than a normal icon in a dialog box. This can either be done using the resource editor or at run time. To display a bitmap using the resource editor place a picture control on a dialog template. Bring up the properties dialog for the picture control and associate the control with a bitmap type (SS_BITMAP style) and an image by specifying a bitmap resource ID. If you want to associate a bitmap resource ID with the picture control only at run time or if you would like to change the bitmap at run time then use the function CStatic::SetBitmap(). 
    To display a bitmap at runtime, the following are the four possible methods: BitBlt() a bitmap onto the dialog box in its OnDraw() handler. 
    BitBlt() or StretchBlt() into a "static" frame control. 
    BitBlt() or StretchBlt() in OnEraseBkgnd(). 
    Use a CBitmapButton as a picture control.