当前位置:网站首页>Aardio - 自己构造的getIconHandle的方法
Aardio - 自己构造的getIconHandle的方法
2022-07-01 07:50:00 【卢光庆】
getIconHandle = function(nIconWidth,nIconHeight){
nIconWidth := ::User32.GetSystemMetrics(0xB/*_SM_CXICON*/);
nIconHeight := ::User32.GetSystemMetrics(0xC/*_SM_CYICON*/);
var XorMask = ..gdip.bitmap(nIconWidth,nIconHeight);
var g1 = XorMask.getGraphics();
g1.drawImageStretch(_bitmap,::RECT(0,0,nIconWidth,nIconHeight));
g1.delete();
var _,h = ::Gdiplus.GdipCreateHICONFromBitmap(XorMask[["pBitmap"]],{ptr h});
XorMask.dispose();
return h[["h"]] ;
//以下是自己构造的方法
/**
nIconWidth := ::User32.GetSystemMetrics(0xB/*_SM_CXICON*/);
nIconHeight := ::User32.GetSystemMetrics(0xC/*_SM_CYICON*/);
var AndMask = ..gdip.bitmap(nIconWidth,nIconHeight);
var g = AndMask.getGraphics();
g.clear(0xFF000000);
g.delete();
var XorMask = ..gdip.bitmap(nIconWidth,nIconHeight);
var g1 = XorMask.getGraphics();
g1.drawImageStretch(_bitmap,::RECT(0,0,nIconWidth,nIconHeight));
g1.delete();
class TIconInfo {
bool fIcon = true;
INT xHotspot = 0;
INT yHotspot = 0;
ptr hbmMask;
ptr hbmColor;
};
var IconInfo = TIconInfo();
IconInfo.hbmMask = AndMask.copyHandle();
IconInfo.hbmColor = XorMask.copyHandle();
var h = ::User32.CreateIconIndirectP(IconInfo);
AndMask.dispose();
XorMask.dispose();
::DeleteObject(IconInfo.hbmMask);
::DeleteObject(IconInfo.hbmColor);
return h;
**/
}
边栏推荐
- Microsoft stream - how to modify video subtitles
- Missing API interface actual development series (14): ID card real name authentication verification
- PWN攻防世界int_overflow
- The H5 page has set the font thickness style, but the wechat access style in Huawei mobile phone doesn't take effect?
- [Shenzhen IO] precise Food Scale (some understanding of assembly language)
- Why some people earn nearly 10billion a year, while others earn 3000 a month: the details you ignore actually make the most money
- How do the top ten securities firms open accounts? In addition, is it safe to open a mobile account?
- How to make the two financial transactions faster
- 【批处理DOS-CMD命令-汇总和小结】-Cmd窗口中常用操作符(<、<<、&<、>、>>、&>、&、&&、||、|、()、;、@)
- Vscode automatically formats code according to eslint specification
猜你喜欢

Apple账号密码自动填充

奥迪AUDI EDI 项目中供应商需要了解哪些信息?

Minecraft 1.16.5 module development (51) tile entity

kubernetes资源对象介绍及常用命令(二)

2022 Guangdong Provincial Safety Officer a certificate third batch (main person in charge) special operation certificate examination question bank simulated examination platform operation

Eigen matrix operation Library

STM32 uses esp01s to go to the cloud, mqtt FX debugging

源代码加密的意义和措施

2022年流动式起重机司机考试练习题及在线模拟考试

论文学习——水文时间序列相似性查询的分析与研究
随机推荐
Sqlalchemy creating MySQL_ Table
Implementation and encapsulation of go universal dynamic retry mechanism
Redisson uses the full solution - redisson official documents + comments (Part 2)
力扣每日一题-第31天-1790.仅执行一次字符串交换能否使两个字符串相等
I bet on performance and won the CTO of the company. I want to build Devops platform!
Saving db4i depth camera pictures with MATLAB
Cadence OrCAD capture "network name" is the same, but it is not connected or connected incorrectly. The usage of nodeName of liberation scheme
凸印的印刷原理及工艺介绍
论文学习——水文时间序列相似性查询的分析与研究
Principle and process of embossing
Redisson uses the full solution - redisson official document + comments (Part 2)
【批处理DOS-CMD-汇总】扩展变量-延迟变量cmd /v:on、cmd /v:off、setlocal enabledelayedexpansion、DisableDelayedExpansion
2022制冷与空调设备运行操作国家题库模拟考试平台操作
The computer has a network, but all browser pages can't be opened. What's the matter?
Eigen matrix operation Library
Gru of RNN
Microsoft announces open source (Godel) language model chat robot
Oracle创建自增id
TCP/UDP 通信问题整理
Caesar