set bitmap to static control
来源:互联网 发布:vscode c 函数插件 编辑:程序博客网 时间:2024/06/05 20:03
序
找了几句代码, 向dialog上的static控件设置图片资源.
实验
// Dialog Data //{{AFX_DATA(CRE_VikingKillerDlg) enum { IDD = IDD_RE_VIKINGKILLER_DIALOG }; CStatic m_CtrlBg; //}}AFX_DATA // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CRE_VikingKillerDlg) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL
void CRE_VikingKillerDlg::DoDataExchange(CDataExchange* pDX){ CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CRE_VikingKillerDlg) DDX_Control(pDX, ID_BG, m_CtrlBg); //}}AFX_DATA_MAP}
BOOL CRE_VikingKillerDlg::OnInitDialog(){ HBITMAP hBitmap; CDialog::OnInitDialog(); // Add "About..." menu item to system menu. // IDM_ABOUTBOX must be in the system command range. ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); ASSERT(IDM_ABOUTBOX < 0xF000); CMenu* pSysMenu = GetSystemMenu(FALSE); if (pSysMenu != NULL) { CString strAboutMenu; strAboutMenu.LoadString(IDS_ABOUTBOX); if (!strAboutMenu.IsEmpty()) { pSysMenu->AppendMenu(MF_SEPARATOR); pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); } } // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon hBitmap = LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_BITMAP_BG)); m_CtrlBg.ModifyStyle(0, SS_BITMAP); // ! must call before SetBitmap m_CtrlBg.SetBitmap(hBitmap); return TRUE; // return TRUE unless you set the focus to a control}
0 0
- set bitmap to static control
- Set Focus to an ASP.NET Control
- Set Access Control to File/Folder (ACL)
- how to implement the version control of static files
- [Windows Phone 7 ] Set cookie to WebBrowser control
- public static Bitmap getMutableBitmap(Bitmap bitmap)
- public static Bitmap createScaledBitmap(
- “Canvas: trying to draw too large bitmap” when Android N Display Size set larger than Small
- How to set the width of columns?about chart control for .net
- NET:Error Creating Control -"Object Reference Not Set To An Instance Of Object"
- [Win32SDK基本]Static Control(2)Image Static Control
- public static Bitmap zoomIn(Bitmap bitmap, int maxW, int maxH)
- Static LED control - CDigiStatic 1.3
- Bitmap to BitmapSource
- view to bitmap
- Bitmap to YUV
- ListView To Bitmap
- Drawable to bitmap
- JavaScript---基本语法学习(二):数组、函数和变量作用域学习
- Java的Integer和int有什么区别
- hello wifi,I'm back!
- 使用内核模块添加系统调用
- opencv实战,钢板焊接点寻找1
- set bitmap to static control
- 彻头彻尾理解单例模式及其在多线程环境中的应用
- 硬盘写到一半时断电,文件系统里会发什么?
- 数据库常见问题整理
- 信息系统项目管理知识--项目立项管理
- vlan 二三层转发
- mybatis数据库查询
- Rxjava Observeable运行线程说明
- python 普通方法、静态方法和类方法有什么区别?