当前位置:网站首页>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;
**/
}
边栏推荐
- 【mysql学习笔记25】sql语句优化
- 【技能】创建.bat快速打开网页
- ONES 创始人王颖奇对话《财富》(中文版):中国有没有优秀的软件?
- LSTM of RNN
- Redisson watchdog mechanism, redisson watchdog performance problems, redisson source code analysis
- How to get a SharePoint online site created using the office365 group template
- Apple account password auto fill
- Missing API interface actual development series (14): ID card real name authentication verification
- Saving db4i depth camera pictures with MATLAB
- [untitled]
猜你喜欢
随机推荐
matlab保存DB4i深度相机图片
Custom events of components ①
What information does the supplier need to know about Audi EDI project?
组件的自定义事件①
Li Kou daily question - day 31 -1790 Can a string exchange be performed only once to make two strings equal
kubernetes资源对象介绍及常用命令(二)
STM32 uses esp01s to go to the cloud, mqtt FX debugging
IMDB practice of emotion classification (simplernn, LSTM, Gru)
Oracle create auto increment ID
Aardio - 阴影渐变文字
Thesis learning -- Analysis and Research on similarity query of hydrological time series
力扣每日一题-第32天-1822.数组元素积的符号
[MySQL learning notes 26] view
Android screen adaptation (using constraintlayout), kotlin array sorting
Php laraver Wechat payment
web254
三极管是一项伟大的发明
How to use layui to display the data in the database in the form of tables
Conscience Amway universal wheel SolidWorks model material website
base64









