获取窗口图标,将其放在画布上,叠加图像,另存为ico(WinXP和Win7) [英] Get window icon, put it on canvas, overlay image, save as ico (WinXP and Win7)
问题描述
目前我使用此代码更改窗口的图标: GitHub - Gist :: Noitidart / _ff-addon-snippet-ChangeWindowIcon.js - Rev2
Right now I change the icon of a window with this code: GitHub - Gist :: Noitidart / _ff-addon-snippet-ChangeWindowIcon.js - Rev2
我想要做的是获取窗口正在使用的当前图标。然后把它放在画布上。然后把另一个图像(徽章),然后将其保存为ico。请帮助。
What I want to do though is get the current icon in use by a window. Then put it on a canvas. Then put another image on that (a badge) then save it as ico. Please help.
感谢
PS:
对于非firefox插件阅读,帮助,我真的很感谢C ++代码获得窗口图标,这将是一个巨大的帮助
PS: For non firefox addon people reading this you can still help, I would really appreciate C++ code to get window icon that would be a huge help
推荐答案
应该工作在一般情况下(有很多fiddling)
Never tried that, however the follow should work in general (with a lot of fiddling)
-
WM_GETICON
- 将图标转换为加载器可以理解的内容(也就是BITMAP或ICO)。例如。 如何将HICON保存到.ico文件?
- 载入图片。例如。 Javascript:将PNG存储为Uint8Array到无数据URI的画布元素
-
canvas.drawImage
-
canvas.mozGetAsFile
(Blob
)或canvas.mozFetchAsStream
$ c> nsIInputStream )使用image / vnd.microsoft.icon
mime。 - 数据和重建图标。
-
LookupIconIdFromDirectoryEx
和CreateIconFromResourceEx
-
WM_SETICON
WM_GETICON
to get the big and small icon.- Convert the icon to something the loader can understand (aka. either a BITMAP or ICO). E.g. How can I save HICON to an .ico file?
- Load the image. E.g. Javascript: Render PNG stored as Uint8Array onto Canvas element without Data URI
canvas.drawImage
canvas.mozGetAsFile
(Blob
) orcanvas.mozFetchAsStream
(nsIInputStream
) using theimage/vnd.microsoft.icon
mime.- Take the resulting data and reconstruct an icon.
LookupIconIdFromDirectoryEx
andCreateIconFromResourceEx
WM_SETICON
这篇关于获取窗口图标,将其放在画布上,叠加图像,另存为ico(WinXP和Win7)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!