There seems to be no way to convert a PNG file to an ICO file.*
Is this definitely true? Just to be safe and not lose my time any longer: Can this be confirmed by an expert here?
Thank you very much in advance.
* By AHK methods only, without third-party tools; ico file containing image data in BMP format, not in PNG format; transparency preserved.
"No way back"...because it is so easy to convert ICO to PNG...
Résumé: Definitely no way back to ICO?
-
- Posts: 493
- Joined: 24 Aug 2016, 03:34
-
- Posts: 493
- Joined: 24 Aug 2016, 03:34
Re: Résumé: Definitely no way back to ICO?
...
No one here who would have mercy on me?
No one here who would have mercy on me?
- tomoe_uehara
- Posts: 213
- Joined: 05 Oct 2013, 12:37
- Contact:
Re: Résumé: Definitely no way back to ICO?
This should be fairly easy with GDIp.
Recommends AHK Studio
-
- Posts: 493
- Joined: 24 Aug 2016, 03:34
Re: Résumé: Definitely no way back to ICO?
I know this post, but the script is no longer available. (And I guess that the script generates ico files with image data in png format.)tomoe_uehara wrote:https://autohotkey.com/board/topic/8241 ... ng-to-ico/
Really? "Supported extensions are: .BMP,.DIB,.RLE,.JPG,.JPEG,.JPE,.JFIF,.GIF,.TIF,.TIFF,.PNG."nnnik wrote: This should be fairly easy with GDIp.
Re: Résumé: Definitely no way back to ICO?
Oh yeah true it would be easily possible with GDIp if you loaded an .ico and turned it into a png.
Anyways I think I found a solution:
First you load the image with gdip then you turn the resulting pBitmap into a hIcon and then you can save it to the file.
https://stackoverflow.com/questions/228 ... n-ico-file
These code pieces show how to save a hIcon to a file. They should give you an idea of what to do.
Anyways I think I found a solution:
First you load the image with gdip then you turn the resulting pBitmap into a hIcon and then you can save it to the file.
https://stackoverflow.com/questions/228 ... n-ico-file
These code pieces show how to save a hIcon to a file. They should give you an idea of what to do.
Recommends AHK Studio
-
- Posts: 493
- Joined: 24 Aug 2016, 03:34
Re: Résumé: Definitely no way back to ICO?
Thank you for your help, nnnik!
I know this posting too (I did a thorough research ). But I assumed that the proposed solution is "nothing to write home about", because nobody here in the AHK community (where the problem was discussed several times!) has picked up this thread.
But anyway, "these code pieces show how to save a hIcon to a file" is far beyond my capabilities...
I know this posting too (I did a thorough research ). But I assumed that the proposed solution is "nothing to write home about", because nobody here in the AHK community (where the problem was discussed several times!) has picked up this thread.
But anyway, "these code pieces show how to save a hIcon to a file" is far beyond my capabilities...
Re: Résumé: Definitely no way back to ICO?
The first example uses a COM Object. This shouldn't be too difficult to do in AHK.
the solutions after that essentially just produce the icon file by completely writing its content using binary data.
In AHK thats either a lot of ugly numputs and gets or you could use a file object.
the solutions after that essentially just produce the icon file by completely writing its content using binary data.
In AHK thats either a lot of ugly numputs and gets or you could use a file object.
Recommends AHK Studio
Who is online
Users browsing this forum: anogoya, Descolada, Mannaia666 and 140 guests