当前位置:网站首页>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;
**/
}
边栏推荐
猜你喜欢
![[recommendation system] breakthrough and imagination of deep location interactive network dpin for meituan takeout recommendation scenario](/img/10/ed857892d2e0ea72e100a4008e6d69.png)
[recommendation system] breakthrough and imagination of deep location interactive network dpin for meituan takeout recommendation scenario

Cyclic neural network

她就是那个「别人家的HR」|ONES 人物

AUTOSAR learning record (1) – ECUM_ Init

Apple账号密码自动填充

Autosar 学习记录(1) – EcuM_Init

Todolist classic case ①

华为ModelArts训练Alexnet模型

三极管是一项伟大的发明

Inftnews | from "avalanche" to Baidu "xirang", 16 major events of the meta universe in 30 years
随机推荐
【mysql学习笔记25】sql语句优化
Sorting out tcp/udp communication problems
力扣每日一题-第31天-1790.仅执行一次字符串交换能否使两个字符串相等
Jax's deep learning and scientific computing
[software] phantomjs screenshot
Download xshell and xftp
Why some people earn nearly 10billion a year, while others earn 3000 a month: the details you ignore actually make the most money
redisson使用全解——redisson官方文档+注释(上篇)
H5 页面设置了字体的粗细样式,但是在华为手机里微信打开访问样式不生效?
base64
Li Kou daily question - day 31 -202 Happy number
论文学习——水文时间序列相似性查询的分析与研究
redisson使用全解——redisson官方文檔+注釋(上篇)
How outlook puts together messages with the same discussion
Sqlalchemy creating MySQL_ Table
2022 operation of refrigeration and air conditioning equipment operation of national question bank simulated examination platform
web254
[MySQL learning notes27] stored procedure
How to troubleshoot SharePoint online map network drive failure?
华为ModelArts训练Alexnet模型