topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday October 15, 2024, 11:20 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: FINISHED: Folder Icon Generator - Customize the picture inside your folder icon  (Read 24833 times)

Stamimail

  • Participant
  • Joined in 2013
  • *
  • default avatar
  • Posts: 23
    • View Profile
    • Donate to Member
I'm using W7.
Look at these folders icons:
https://terraromaste...iantart.com/gallery/
https://acidcrashlv....iantart.com/gallery/

Do you think is it possible to make a program that:
1. Take (load) any picture (png, bmp, jpg, ico ...)
2. Creating a folder icon with this picture inside.

I think the default Windows folder icon is located here:
C:\Windows\system32\imageres.dll
(zip attached)

The result will be:
256x256
FolderIconWithPicture.png
or better
FolderIconWithPicture.ico

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
:) Try ImageToFolderIcon! Choose an image file and a folder, and it will change the icon of the folder.

ImageToFolderIcon.jpgFINISHED: Folder Icon Generator - Customize the picture inside your folder icon

It's a first draft, test it and give me some feedback. You may have to restart explorer.exe or your computer to force the folder icon to update, I'll see if there's a solution to this.

Save the script as ImageToFolderIcon.ahk. Download and install AutoHotkey to run the script.

06.09.2017: Added folder image to icon. Download and place Folder.png and Flip.png in the same folder as the script.
06.09.2017: Made the icon path relative to allow for moving of folders.

Skrommel
« Last Edit: September 05, 2017, 07:18 PM by skrommel »

Stamimail

  • Participant
  • Joined in 2013
  • *
  • default avatar
  • Posts: 23
    • View Profile
    • Donate to Member
Hi,
There were some issues:
1. I think it doesn't support unicode. I have unicode in my paths.
2. It needs to put a image in a folder, and not to change the whole folder icon to other image (can be done by properties > customize).
3. When you Rename the folder name, the image is lost. It is not happening when you using properties > customize.

https://snag.gy/TSI49c.jpg

I think it will better if:
The result will be:
256x256
FolderIconWithPicture.png
or
FolderIconWithPicture.ico
because the user must save the icon somewhere in his computer.
I for example, have an Icons folder for these tasks.
« Last Edit: September 05, 2017, 04:53 PM by Stamimail »

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Thanks, Skrommel!

Crap...thought I posted in this thread already.  This has been requested before; check here for some alternatives by myself and c.gingerich:

https://www.donation...ex.php?topic=42838.0

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Actually...now that I read the initial post more closely, the request is a bit different from the thread I mention.  I think the OP wants a program that will take two images (the folder image and the "custom" image) and then make a composite of them.  Is that correct, Stamimail?

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
@Stamimail: Added a folder to the icon, sorry I didn't interpret your description correctly the first time. Download the Folder.png and Flip.png and place them in the same folder as the script.

About the unicode filenames, did you download the unicode version of AutoHotkey?

I also removed the path of the icon-file to make it work if a folder is moved.
« Last Edit: September 06, 2017, 01:35 AM by skrommel »

Stamimail

  • Participant
  • Joined in 2013
  • *
  • default avatar
  • Posts: 23
    • View Profile
    • Donate to Member
Yes. How the result should look:
Take any image you want, place it in a folder, and renamed it to: Folder.jpg (or Folder.gif).
Now, you can see the desired result.

The problem with this method is - it works only for Thumbnails view. It won't work for Details view.

@skrommel
1. You can find Folder and Filp icons in Icons.zip I had attached, or you can extract from imageres.dll.
2. There still issues:
a. The Folder created, created in the Root (D:\), and not for the chosen folder.
b. There is a problem with the resolution of the result. It should be 256x256 for Extra Large Thumbnails view.

There is a question to be asked:
Where is better to save and load the image icon from:
- Within the chosen folder - Each folder has its icon.
or
- Dedicated icons folder of User - One icon for multiple folders.

IMO, you will have to use the second method, to load the icon from a "Dedicated icons folder of User", because if you will put the icon within the folder, it will no longer work when the folder path will changed/renamed.

Stamimail

  • Participant
  • Joined in 2013
  • *
  • default avatar
  • Posts: 23
    • View Profile
    • Donate to Member
As you have already understood, the new icon will consist of three layers.
1. Folder png [256x256]
2. User Image [Resized to: ???][I don't know what's default. It will be advanced if the user will able to decide on resize and location X Y Z]
3. Flip png [256x256]

I think it will be better to give the user the default folder pngs: 1. and 3.
so that he will be able to replace the 1. and 3. layers with other folders templates.

Stamimail

  • Participant
  • Joined in 2013
  • *
  • default avatar
  • Posts: 23
    • View Profile
    • Donate to Member
Now that I'm thinking about it,
there are some cases that the user needs only the icon, without applying it on a chosen folder, like if he wants to use the icon in Classic Explorer Bar of Classic Shell.
So I think that this progam should only create an icon. (and not trying to apply it on a chosen folder)

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
For generation icons, maybe ImageMagick is a better tool? You can layer and position images, and export them to an icon, all using the command line.

output.pngFINISHED: Folder Icon Generator - Customize the picture inside your folder icon

Download and install ImageMagick here.

Here's a script that resizes 2.jpg,
merges 1.png, 2.jpg and 3.png,
saves the result as icon.ico. 

Save the script at Merge.cmd in the ImageMagic folder, also either place the images here, or change the script to point to the correct images.

convert.exe 2.jpg -resize 216x216 output.png
convert.exe 1.png output.png -gravity center -composite output.png
convert.exe output.png 3.png -gravity center -composite output.png
convert.exe output.png -define icon:auto-resize=256,128,64,48,32,16 icon.ico
« Last Edit: September 08, 2017, 05:00 PM by skrommel »

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
 :) Try ImagesToIcon! It will create an icon from three images drawn on top of each other.

ImagesToIcon.jpgFINISHED: Folder Icon Generator - Customize the picture inside your folder icon

Use 256x256 pixel PNG-files for File1 and File3. File2 can be PNG, JPG or BMP and is resized to 216x216 pixels.
The file Icon1.ico is created in the selected folder, and renamed automatically if the file already exists.

The first time it runs, it downloads and unpacks ImageMagic and three test PNG-files. Also, the last used files and folder paths are saved to ImagesToIcon.ini.

Skrommel
« Last Edit: September 08, 2017, 04:57 PM by skrommel »

Stamimail

  • Participant
  • Joined in 2013
  • *
  • default avatar
  • Posts: 23
    • View Profile
    • Donate to Member
I didn't try yet the new ImagesToIcon,
but I did some tests, and I figured out that, if you edit the desktop.ini file within the created folder, you will be able to move/rename the created folder as you wish.
You need just to remove the path part like this:
From
[.ShellClassInfo]
IconResource=D:\Some\Path\FolderIcon.ico,0
to
[.ShellClassInfo]
IconResource=FolderIcon.ico,0

Another thing to add, a suggestion, you can make 2 checkboxes:
[ ] Create a folder
[ ] Create a FolderIcon.ico

If user check the both 2 checkboxes, it means you need to create 2 icons:
1 hidden icon for the new created folder, within the folder like the file desktop.ini
and
1 not-hidden icon as FolderIcon.ico

It's always better to have an open-source code, for customization.

Rockets

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 57
    • View Profile
    • Donate to Member
It doesn't download ImageMagic, here you can get it manually https://sourceforge....gick/files/im7-exes/

Stamimail

  • Participant
  • Joined in 2013
  • *
  • default avatar
  • Posts: 23
    • View Profile
    • Donate to Member
Do you know how to control the size/position of the icon inside?

Rockets

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 57
    • View Profile
    • Donate to Member

dglp

  • Participant
  • Joined in 2008
  • *
  • default avatar
  • Posts: 11
    • View Profile
    • Donate to Member
I've just been looking at this in a renewed attempt to customize the folders I keep open in my taskbar. Over the last year or so I've tried a half dozen applications, alongside the native customization panel. None have worked - including this icon generator.

Turns out that it's the Windows (7) inability to work with NAS files. This app, and various others, work on internal hard drives, and removable memory, but not networked drives. So now I'm looking for a solution to either the immediate challenge of customizing NAS folder icons, or reworking Windows 7 so that it extends functionality to NAS drives. Maybe those are one and the same?

Any thoughts?