forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

%ic

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Sun Jul 31, 2011 3:04 pm    Post subject: %ic Reply with quote

When I use %ic with an icon resource that contains multiple icons (in different sizes) Clearwin selects the first icon (in my file it is also the largest). Is there any way to pick a different size of icon out of the file?

It looked to me as though the instructions for %`ic hinted that I might be able to do this - but I found the instructions difficult to follow.

I have no problem with the answer being "yes, it only takes the first", because I can easily put each size in a separate ICO file, just curiosity makes me ask.

I have found 32-bit icons work extremely well (24-bit plus the transparency).

Eddie
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Sun Jul 31, 2011 3:49 pm    Post subject: Reply with quote

It only takes the first icon
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Tue Aug 02, 2011 1:52 pm    Post subject: Reply with quote

Thanks Paul. Pity, though. My RESOURCES section is very long. Also, it might simplify the problem of dealing with different size screens - I'm covering everything from 800x600 all the way to dual screen setups 2x2560x1600, on which a 16x16 icon is barely visible !

Eddie
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Tue Aug 02, 2011 3:33 pm    Post subject: Reply with quote

It may be possible to use the ExtractIconEx API in order to get a list of icon handles and then use one of them in %`ic.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Tue Aug 02, 2011 5:53 pm    Post subject: Reply with quote

Paul,

It probably is possible, but looks more complicated than doing them one at a timein RESOURCES. Thanks for looking it out for me.

Eddie
Back to top
View user's profile Send private message
Wilfried Linder



Joined: 14 Nov 2007
Posts: 314
Location: Düsseldorf, Germany

PostPosted: Tue Aug 02, 2011 7:16 pm    Post subject: Reply with quote

In some cases I've several icons in one resource file like here:

t1_icon ICON c:\lisa_g\icons\symb_1.ico
t2_icon ICON c:\lisa_g\icons\symb_2.ico
t3_icon ICON c:\lisa_g\icons\symb_3.ico

I select the required icon using %bi[t2_icon] for instance.

In principal, within my resource files I have first all icons, then all cursors and after that all bitmaps I need. In the first row of the resource file should be located the main icon which is also used as deskop icon when the programme was installed, for instance

l_icon ICON c:\lisa_g\icons\lisa.ico

This I call using %mi[l_icon] in the main window of my software.

I don't know if this may help you, Eddie.

Best regards
Wilfried
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Tue Aug 02, 2011 8:30 pm    Post subject: Reply with quote

Hi Wilfried,

Many thanks for the suggestion - which is about what I do. I have to say that until recently, I only used 2 icons for the application (e.g. the minimise icon, and also the application icon which is larger). (I also use the standard icons with %si). Elsewhere I have used bitmaps (BMP) where it serves the purpose of an icon, i.e. as "decoration".

The problem with a BMP bitmap is that it must be rectangular, and what I wanted wasn't. I started by drawing them on a grey background, and this merged in with the grey background that Clearwin gave me. However, the grey is different in various user themes, and even different between the various Windows versions, XP, Vista and 7. At the time, I was using v 4.90 which doesn't support the %gi format code (I'm now on 6.10) and so I investigated icons to use with %ic. They are only "decorations" on some of my windows.

I drew all of my 15 new icons using IcoFX freeware program, basically by importing the BMP files and then making the grey areas transparent. All of them (and the two original icons) are single images, fixed in size. I have them listed in my .RC file (4.90 didn't support some things in a RESOURCES section and so I compiled the resources separately).

Most of us, me included, aren't real artists, especially down at 16x16 pixels or even 32x32. I therefore look on the web for things that I could use, although I never do an outright copy, simply note the design features and produce my own version. I have a popup help window that explains what every mouse click does. For "artistic" reasons, it has a picture of a mouse. At the moment I do it with a BMP with a white background, and that works OK because the help info also has a white background. Anyway, I found an excellent mouse icon with transparency, drop shadow effect etc etc - but it there as 5 versions of it from 128x128 down to 32x32 pixels. When I tried it in my code I got the first (biggest) one. Hence my original question.

If I decide to use just one of the icon sizes, I can chop it out of the icon file and put it somewhere on its own with IcoFX. My question was about this case of multiple resolutions with just one ICO file. I had an idea that I might get all my icons in one ICO file!

Regards

Eddie
Back to top
View user's profile Send private message
Wilfried Linder



Joined: 14 Nov 2007
Posts: 314
Location: Düsseldorf, Germany

PostPosted: Wed Aug 03, 2011 6:24 am    Post subject: Reply with quote

Hi Eddie,

OK, now I understand. Mostly I use BMPs for buttons as well as for "decoration". I create them with Windows Paint in 24 bits. The border pixels should have a value of 192 (for R, G and B) which is recognized as "background", and until now, this works (with a behaviour like the transparency in GIFs).

I never tested multiple resolution of single icons or bitmaps and I have no idea if or how this might be possible. May be the only way is to create the bitmaps in different sizes with different names and call the one you want after you have detected the actual screen resolution.

Best regards
Wilfried
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group