当前位置:网站首页>Aardio - Method of self constructed geticonhandle
Aardio - Method of self constructed geticonhandle
2022-07-01 07:56:00 【Luguangqing】
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"]] ;
// The following is a self constructed method
/**
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;
**/
}
边栏推荐
- How relational databases work
- [recommendation system] breakthrough and imagination of deep location interactive network dpin for meituan takeout recommendation scenario
- The Windows C disk is full
- How to make the two financial transactions faster
- [kv260] generate chip temperature curve with xadc
- Todolist classic case ①
- Atguigu---- scaffold --02- use scaffold (2)
- Basic knowledge of MATLAB
- Basic number theory -- combinatorial number
- 力扣每日一题-第31天-1790.仅执行一次字符串交换能否使两个字符串相等
猜你喜欢

AUTOSAR learning record (1) – ECUM_ Init

base64

下载Xshell和Xftp

2022 mobile crane driver test exercises and online simulation test

SharePoint - how to quickly check whether SharePoint is standard or enterprise edition?

Wang Yingqi, founder of ones, talks to fortune (Chinese version): is there any excellent software in China?

2022 tea master (intermediate) recurrent training question bank and answers

Eigen matrix operation Library

Download xshell and xftp

Android screen adaptation (using constraintlayout), kotlin array sorting
随机推荐
How to make the two financial transactions faster
力扣每日一题-第31天-1502.判断能否形成等差数列
Redisson uses the full solution - redisson official document + comments (Part 2)
组件的自定义事件①
【mysql学习笔记27】存储过程
Download xshell and xftp
Oracle create auto increment ID
I bet on performance and won the CTO of the company. I want to build Devops platform!
postgresql源码学习(26)—— Windows vscode远程调试Linux上的postgresql
凸印的印刷原理及工艺介绍
Latex formula code
长路漫漫、技术作伴
AArdio - 【问题】bass库回调时内存增长的问题
Todolist classic case ①
sqlalchemy创建MySQL_Table
【R语言】两个/N个数据合并merge函数
2022 operation of refrigeration and air conditioning equipment operation of national question bank simulated examination platform
Custom events of components ①
LSTM of RNN
Custom events of components ②