获取窗口图标,将其放在画布上,叠加图像,另存为ico(WinXP和Win7) [英] Get window icon, put it on canvas, overlay image, save as ico (WinXP and Win7)

查看:162
本文介绍了获取窗口图标,将其放在画布上,叠加图像,另存为ico(WinXP和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)


  1. WM_GETICON

  2. 将图标转换为加载器可以理解的内容(也就是BITMAP或ICO)。例如。 如何将HICON保存到.ico文件?

  3. 载入图片。例如。 Javascript:将PNG存储为Uint8Array到无数据URI的画布元素

  4. canvas.drawImage

  5. canvas.mozGetAsFile Blob )或 canvas.mozFetchAsStream $ c> nsIInputStream )使用 image / vnd.microsoft.icon mime。

  6. 数据和重建图标。

  7. LookupIconIdFromDirectoryEx CreateIconFromResourceEx

  8. WM_SETICON

  1. WM_GETICON to get the big and small icon.
  2. 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?
  3. Load the image. E.g. Javascript: Render PNG stored as Uint8Array onto Canvas element without Data URI
  4. canvas.drawImage
  5. canvas.mozGetAsFile (Blob) or canvas.mozFetchAsStream (nsIInputStream) using the image/vnd.microsoft.icon mime.
  6. Take the resulting data and reconstruct an icon.
  7. LookupIconIdFromDirectoryEx and CreateIconFromResourceEx
  8. WM_SETICON

这篇关于获取窗口图标,将其放在画布上,叠加图像,另存为ico(WinXP和Win7)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆