当前位置:网站首页>MFC picture control
MFC picture control
2022-07-26 10:51:00 【Forest_ one thousand and ten】
Picture control can display pictures , Its essence is CStatic class , Only need to create dwStyle Make style SS_BITMAP that will do .
First step : Define in the dialog class :
CStatic m_picture;
The second step : In the dialog class OnInitDialog Function :
m_picture.Create(L"XX",WS_CHILD|WS_VISIBLE|WS_BORDER|SS_BITMAP,
CRect(100,100,300,300),this,10000);// Create the picture control
// Parameters 1: Write casually , It won't show
// Parameters 2:dwStyle Make style SS_BITMAP
// Parameters 3: Picture display area Top left coordinates (100,100) The lower right corner (300,300)
// Parameters 4: The parent window ,this Refers to the dialog window
The third step : Add a bitmap resource
Step four : Load bitmap for picture control
HBITMAP hBmp=LoadBitmap(AfxGetInstanceHandle(),// Instance handle
MAKEINTRESOURCE(IDB_BITMAP1_ONE));// Load bitmap through resources
m_picture.SetBitmap(hBmp);
If the picture is too big , It cannot be completely displayed , have access to DC Drawing realizes the scaling of pictures .
边栏推荐
- Bash shell学习笔记(四)
- @Notblank, @notnull, @notempty differences and uses
- c结构体中定义的成员指针赋值与结构体指针作为成员函数参数的使用
- @The real difference and usage between validated and @valid
- 企鹅龙(DRBL)无盘启动+再生龙(clonezilla)网络备份与还原系统
- 使用float实现左中右布局,中间内容自适应
- Sql Server之查询总结
- Error[Pe147]: declaration is incompatible with '错误问题
- @Validated 和 @Valid 的真正区别和使用方式
- RT-Thread 学习笔记(三)---用SCons 构建编译环境
猜你喜欢

Codepoint 58880 not found in font, aborting. flutter build apk时报错

Software Testing Overview: the background, essence and process of software testing

0x00007FFD977C04A8 (Qt5Sqld.dll)处(位于 a.exe 中)引发的异常: 0xC0000005: 读取位置 0x0000000000000010 时发生访问冲突

很多人都不清楚自己找的是Kanban软件还是看板软件

解决:无法加载文件 C:\Users\user\AppData\Roaming\npm\npx.ps1,因为在此系统上禁止运行脚本 。

242.有效的字母异位词

Bash shell学习笔记(一)

The problem of formatting IAR sprintf floating point to 0.0 in UCOS assembly

RT thread learning notes (VII) -- open the elmfat file system based on SPI flash (middle)

@NotBlank、@NotNull 、@NotEmpty 区别和使用
随机推荐
C语言命名空间的定义与使用
Definition and use of C language namespace
Sql Server 之SQL语句对基本表及其中的数据的创建和修改
Disable usbjatg in Altium Designer
Constructors, method overloads, object arrays, and static
Sword finger offer (43): left rotation string
[machine learning notes] [face recognition] deeplearning ai course4 4th week programming
SQL Server 之Sql语句创建数据库
BigDecimal's addition, subtraction, multiplication and division, size comparison, rounding up and down, and BigDecimal's set accumulation, judge whether BigDecimal has decimal
Error[pe147]: declaration is incompatible with 'error problem
RT-Thread 学习笔记(一)---配置RT-Thread开发环境
2021-08-14 Sanzi chess
[leetcode daily question 2021/5/8]1723. The shortest time to complete all work
The assignment of member pointer defined in C structure and the use of structure pointer as member function parameter
Sql Server之查询总结
鹏哥C语言20210811程序结构作业
Bash shell学习笔记(一)
1837.K进制表示下的各位数字总和
RT thread learning notes (III) -- building a compilation environment with scons
shell 脚本 失败自动重复执行