Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #11188 > unrolled thread

Icon sizes in VO application

Started by"Wolfgang Riedmann" <wriedmann@gmail.com>
First post2017-11-29 08:06 +0100
Last post2017-12-06 13:53 +0100
Articles 8 — 4 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  Icon sizes in VO application "Wolfgang Riedmann" <wriedmann@gmail.com> - 2017-11-29 08:06 +0100
    Re: Icon sizes in VO application "Wolfgang Riedmann" <wriedmann@gmail.com> - 2017-11-29 09:31 +0100
    Re: Icon sizes in VO application "Dirk (Belgium)" <dirk.dot.herijgers@pbprojects.dot.be> - 2017-11-29 09:45 +0000
      Re: Icon sizes in VO application "Wolfgang Riedmann" <wriedmann@gmail.com> - 2017-11-29 11:41 +0100
        Re: Icon sizes in VO application Robert van der Hulst <rjvanderhulst@gmail.com> - 2017-11-29 06:15 -0800
          Re: Icon sizes in VO application "Wolfgang Riedmann" <wriedmann@gmail.com> - 2017-11-30 18:44 +0100
            Re: Icon sizes in VO application Arne Ortlinghaus <Arne.Ortlinghaus@acs.it> - 2017-12-04 10:14 +0100
          Re: Icon sizes in VO application "Wolfgang Riedmann" <wriedmann@gmail.com> - 2017-12-06 13:53 +0100

#11188 — Icon sizes in VO application

From"Wolfgang Riedmann" <wriedmann@gmail.com>
Date2017-11-29 08:06 +0100
SubjectIcon sizes in VO application
Message-ID<f874jgFekpcU1@mid.individual.net>
Hi all,

I have a customer that is very graphics oriented - they even let design
the icons for their applications (ok, they have their own graphics
department).
Unfortunately VO seems to take only the largest icon resolution from
the icon file. Is there anything I can do to change this?

I have created a sample icon that contains icons in the resolutions
16x16, 24x24, 32x32, 48x48, 64x64 and 128x128. Every icon shows its
dimension (from 16 to 128), but the icon that is shown in the taskbar
(16x16 pixel) shows "128", so it is downsized from the 128x128 instead
of taking the 16x16 icon (that would show "16").

Has anyone any solution or played with this?

Wolfgang

-- 

[toc] | [next] | [standalone]


#11189

From"Wolfgang Riedmann" <wriedmann@gmail.com>
Date2017-11-29 09:31 +0100
Message-ID<f879j0FfnguU1@mid.individual.net>
In reply to#11188
Hi all,

Windows does not seem to behave as documented.....

I was able to solve it partially using the :IconSM assign of the Window
class.

And I have changed the Init() method of the icons:

method Init( nSize ) class myIcon
   super:init(ResourceID{"MYICON", _GetInst()},, nSize, nSize )
   return self

and in the Init() method of the Window:

self:Icon := myIcon{}
self:IconSM := myIcon{ 16 }

Wolfgang

> Hi all,
> 
> I have a customer that is very graphics oriented - they even let
> design the icons for their applications (ok, they have their own
> graphics department).
> Unfortunately VO seems to take only the largest icon resolution from
> the icon file. Is there anything I can do to change this?
> 
> I have created a sample icon that contains icons in the resolutions
> 16x16, 24x24, 32x32, 48x48, 64x64 and 128x128. Every icon shows its
> dimension (from 16 to 128), but the icon that is shown in the taskbar
> (16x16 pixel) shows "128", so it is downsized from the 128x128 instead
> of taking the 16x16 icon (that would show "16").
> 
> Has anyone any solution or played with this?
> 
> Wolfgang



-- 

[toc] | [prev] | [next] | [standalone]


#11190

From"Dirk (Belgium)" <dirk.dot.herijgers@pbprojects.dot.be>
Date2017-11-29 09:45 +0000
Message-ID<ovlvjb$7eo$1@dont-email.me>
In reply to#11188
Hi wolfgang,

No problem at all to read all the icons of different size out of 1 big
ICO-file.

Suppose, you have a file with 2 icons (16x16 and 32x32).
This is the code you need to read these icons:
RESOURCE Connect_TwoIcons Icon C:\Temp\Connect.Ico
CLASS Connect16_Icon INHERIT Icon
METHOD Init() CLASS Connect16_Icon
	SUPER:Init(ResourceID{"Connect_TwoIcons",_GetInst()},,16,16)
RETURN SELF
CLASS Connect32_Icon INHERIT Icon
METHOD Init() CLASS Connect32_Icon
	SUPER:Init(ResourceID{"Connect_TwoIcons",_GetInst()},,32,32)
RETURN SELF

Cheers, Dirk

================================================

Wolfgang Riedmann wrote:

> Hi all,
> 
> I have a customer that is very graphics oriented - they even let
> design the icons for their applications (ok, they have their own
> graphics department).
> Unfortunately VO seems to take only the largest icon resolution from
> the icon file. Is there anything I can do to change this?
> 
> I have created a sample icon that contains icons in the resolutions
> 16x16, 24x24, 32x32, 48x48, 64x64 and 128x128. Every icon shows its
> dimension (from 16 to 128), but the icon that is shown in the taskbar
> (16x16 pixel) shows "128", so it is downsized from the 128x128 instead
> of taking the 16x16 icon (that would show "16").
> 
> Has anyone any solution or played with this?
> 
> Wolfgang

[toc] | [prev] | [next] | [standalone]


#11192

From"Wolfgang Riedmann" <wriedmann@gmail.com>
Date2017-11-29 11:41 +0100
Message-ID<f87h6lFhfldU1@mid.individual.net>
In reply to#11190
Hi Dirk,

> No problem at all to read all the icons of different size out of 1 big
> ICO-file.

yes, I have found that also.

But Windows should do this itself: if the icon has more sizes in the
same file, Windows should select the most appriate icon to display.
I don't know if this a problem specific to VO...

Wolfgang


> 
> Suppose, you have a file with 2 icons (16x16 and 32x32).
> This is the code you need to read these icons:
> RESOURCE Connect_TwoIcons Icon C:\Temp\Connect.Ico
> CLASS Connect16_Icon INHERIT Icon
> METHOD Init() CLASS Connect16_Icon
> 	SUPER:Init(ResourceID{"Connect_TwoIcons",_GetInst()},,16,16)
> RETURN SELF
> CLASS Connect32_Icon INHERIT Icon
> METHOD Init() CLASS Connect32_Icon
> 	SUPER:Init(ResourceID{"Connect_TwoIcons",_GetInst()},,32,32)
> RETURN SELF
> 
> Cheers, Dirk
> 
> ================================================
> 
> Wolfgang Riedmann wrote:
> 
> > Hi all,
> > 
> > I have a customer that is very graphics oriented - they even let
> > design the icons for their applications (ok, they have their own
> > graphics department).
> > Unfortunately VO seems to take only the largest icon resolution from
> > the icon file. Is there anything I can do to change this?
> > 
> > I have created a sample icon that contains icons in the resolutions
> > 16x16, 24x24, 32x32, 48x48, 64x64 and 128x128. Every icon shows its
> > dimension (from 16 to 128), but the icon that is shown in the
> > taskbar (16x16 pixel) shows "128", so it is downsized from the
> > 128x128 instead of taking the 16x16 icon (that would show "16").
> > 
> > Has anyone any solution or played with this?
> > 
> > Wolfgang



-- 

[toc] | [prev] | [next] | [standalone]


#11194

FromRobert van der Hulst <rjvanderhulst@gmail.com>
Date2017-11-29 06:15 -0800
Message-ID<3866a2ed-edb5-4211-af6d-0fb367ad8890@googlegroups.com>
In reply to#11192
Wolfgang,

The icon class uses LoadImage() to load the image.

The documentation of the LoadImage() WIn32 api function says about these sizes that the behavior is dependent on the fuLoad parameter.
VO passes LR_DEFAULTCOLOR (0), which means that LR_DEFAULTSIZE is not specified. 

The docs say about this flag: 

If this flag is not specified and cxDesired and cyDesired are set to zero, the function uses the actual resource size. If the resource contains multiple images, the function uses the size of the first image.

Your icon has multiple images, so it uses the size of the first image.


Robert

> Hi Dirk,
> 
> > No problem at all to read all the icons of different size out of 1 big
> > ICO-file.
> 
> yes, I have found that also.
> 
> But Windows should do this itself: if the icon has more sizes in the
> same file, Windows should select the most appriate icon to display.
> I don't know if this a problem specific to VO...
> 
> Wolfgang
> 
> 
> > 
> > Suppose, you have a file with 2 icons (16x16 and 32x32).
> > This is the code you need to read these icons:
> > RESOURCE Connect_TwoIcons Icon C:\Temp\Connect.Ico
> > CLASS Connect16_Icon INHERIT Icon
> > METHOD Init() CLASS Connect16_Icon
> > 	SUPER:Init(ResourceID{"Connect_TwoIcons",_GetInst()},,16,16)
> > RETURN SELF
> > CLASS Connect32_Icon INHERIT Icon
> > METHOD Init() CLASS Connect32_Icon
> > 	SUPER:Init(ResourceID{"Connect_TwoIcons",_GetInst()},,32,32)
> > RETURN SELF
> > 
> > Cheers, Dirk
> > 
> > ================================================
> > 
> > Wolfgang Riedmann wrote:
> > 
> > > Hi all,
> > > 
> > > I have a customer that is very graphics oriented - they even let
> > > design the icons for their applications (ok, they have their own
> > > graphics department).
> > > Unfortunately VO seems to take only the largest icon resolution from
> > > the icon file. Is there anything I can do to change this?
> > > 
> > > I have created a sample icon that contains icons in the resolutions
> > > 16x16, 24x24, 32x32, 48x48, 64x64 and 128x128. Every icon shows its
> > > dimension (from 16 to 128), but the icon that is shown in the
> > > taskbar (16x16 pixel) shows "128", so it is downsized from the
> > > 128x128 instead of taking the 16x16 icon (that would show "16").
> > > 
> > > Has anyone any solution or played with this?
> > > 
> > > Wolfgang
> 
> 
> 
> --

[toc] | [prev] | [next] | [standalone]


#11204

From"Wolfgang Riedmann" <wriedmann@gmail.com>
Date2017-11-30 18:44 +0100
Message-ID<f8aubbFbeovU1@mid.individual.net>
In reply to#11194
Hi Robert,

thank you very much! I will try it in the next days and let you know.

Wolfgang

> The icon class uses LoadImage() to load the image.
> 
> The documentation of the LoadImage() WIn32 api function says about
> these sizes that the behavior is dependent on the fuLoad parameter.
> VO passes LR_DEFAULTCOLOR (0), which means that LR_DEFAULTSIZE is not
> specified.
> 
> The docs say about this flag: 
> 
> If this flag is not specified and cxDesired and cyDesired are set to
> zero, the function uses the actual resource size. If the resource
> contains multiple images, the function uses the size of the first
> image.
> 
> Your icon has multiple images, so it uses the size of the first image.
> 
> 
> Robert
> 
> > Hi Dirk,
> > 
> > > No problem at all to read all the icons of different size out of
> > > 1 big ICO-file.
> > 
> > yes, I have found that also.
> > 
> > But Windows should do this itself: if the icon has more sizes in the
> > same file, Windows should select the most appriate icon to display.
> > I don't know if this a problem specific to VO...
> > 
> > Wolfgang
> > 
> > 
> > > 
> > > Suppose, you have a file with 2 icons (16x16 and 32x32).
> > > This is the code you need to read these icons:
> > > RESOURCE Connect_TwoIcons Icon C:\Temp\Connect.Ico
> > > CLASS Connect16_Icon INHERIT Icon
> > > METHOD Init() CLASS Connect16_Icon
> > > 	SUPER:Init(ResourceID{"Connect_TwoIcons",_GetInst()},,16,16)
> > > RETURN SELF
> > > CLASS Connect32_Icon INHERIT Icon
> > > METHOD Init() CLASS Connect32_Icon
> > > 	SUPER:Init(ResourceID{"Connect_TwoIcons",_GetInst()},,32,32)
> > > RETURN SELF
> > > 
> > > Cheers, Dirk
> > > 
> > > ================================================
> > > 
> > > Wolfgang Riedmann wrote:
> > > 
> > > > Hi all,
> > > > 
> > > > I have a customer that is very graphics oriented - they even let
> > > > design the icons for their applications (ok, they have their own
> > > > graphics department).
> > > > Unfortunately VO seems to take only the largest icon resolution
> > > > from the icon file. Is there anything I can do to change this?
> > > > 
> > > > I have created a sample icon that contains icons in the
> > > > resolutions 16x16, 24x24, 32x32, 48x48, 64x64 and 128x128.
> > > > Every icon shows its dimension (from 16 to 128), but the icon
> > > > that is shown in the taskbar (16x16 pixel) shows "128", so it
> > > > is downsized from the 128x128 instead of taking the 16x16 icon
> > > > (that would show "16").
> > > > 
> > > > Has anyone any solution or played with this?
> > > > 
> > > > Wolfgang
> > 
> > 
> > 
> > --



-- 

[toc] | [prev] | [next] | [standalone]


#11209

FromArne Ortlinghaus <Arne.Ortlinghaus@acs.it>
Date2017-12-04 10:14 +0100
Message-ID<p033lr$1k56$1@gioia.aioe.org>
In reply to#11204

[Multipart message — attachments visible in raw view] — view raw

Hi Wolfgang,

we use the attached class for deriving our icons. It works with icon 
resources containing multiple icons.

It is also important to have the right imagelists. The imagelists are 
created with:

oDim := Dimension {nWidth, nWidth} with nwidth = 16 or 32 or 48

_oimagelist := createinstance(#ImageList, 32, odim , null_object, 
_or(ILC_COLOR32,ILC_MASK))

I do not remember currently, there were some places where it was better 
to use a 32 pixel icon and have it reduced by Windows commands to 16 
instead of selecting the 16 pixel icon.

Arne

[toc] | [prev] | [next] | [standalone]


#11219

From"Wolfgang Riedmann" <wriedmann@gmail.com>
Date2017-12-06 13:53 +0100
Message-ID<f8q7i3FrsmrU1@mid.individual.net>
In reply to#11194
Hi Robert,

I have now done some more tests. 

LR_DEFAULTSIZE in my case loads the 128x128 icon.

The desired behaviour would be that Windows at runtime chooses the
correct icon size from the executable, instead of downscaling large
resolutions.

The best option remains to set both the :Icon and the :IconSM assigns
of the Window, and specifying the desired icon size (16x16 seems to be
the best for the :IconSM assign).

Wolfgang

Robert van der Hulst wrote:

> Wolfgang,
> 
> The icon class uses LoadImage() to load the image.
> 
> The documentation of the LoadImage() WIn32 api function says about
> these sizes that the behavior is dependent on the fuLoad parameter.
> VO passes LR_DEFAULTCOLOR (0), which means that LR_DEFAULTSIZE is not
> specified.
> 
> The docs say about this flag: 
> 
> If this flag is not specified and cxDesired and cyDesired are set to
> zero, the function uses the actual resource size. If the resource
> contains multiple images, the function uses the size of the first
> image.
> 
> Your icon has multiple images, so it uses the size of the first image.
> 
> 
> Robert
> 
> > Hi Dirk,
> > 
> > > No problem at all to read all the icons of different size out of
> > > 1 big ICO-file.
> > 
> > yes, I have found that also.
> > 
> > But Windows should do this itself: if the icon has more sizes in the
> > same file, Windows should select the most appriate icon to display.
> > I don't know if this a problem specific to VO...
> > 
> > Wolfgang
> > 
> > 
> > > 
> > > Suppose, you have a file with 2 icons (16x16 and 32x32).
> > > This is the code you need to read these icons:
> > > RESOURCE Connect_TwoIcons Icon C:\Temp\Connect.Ico
> > > CLASS Connect16_Icon INHERIT Icon
> > > METHOD Init() CLASS Connect16_Icon
> > > 	SUPER:Init(ResourceID{"Connect_TwoIcons",_GetInst()},,16,16)
> > > RETURN SELF
> > > CLASS Connect32_Icon INHERIT Icon
> > > METHOD Init() CLASS Connect32_Icon
> > > 	SUPER:Init(ResourceID{"Connect_TwoIcons",_GetInst()},,32,32)
> > > RETURN SELF
> > > 
> > > Cheers, Dirk
> > > 
> > > ================================================
> > > 
> > > Wolfgang Riedmann wrote:
> > > 
> > > > Hi all,
> > > > 
> > > > I have a customer that is very graphics oriented - they even let
> > > > design the icons for their applications (ok, they have their own
> > > > graphics department).
> > > > Unfortunately VO seems to take only the largest icon resolution
> > > > from the icon file. Is there anything I can do to change this?
> > > > 
> > > > I have created a sample icon that contains icons in the
> > > > resolutions 16x16, 24x24, 32x32, 48x48, 64x64 and 128x128.
> > > > Every icon shows its dimension (from 16 to 128), but the icon
> > > > that is shown in the taskbar (16x16 pixel) shows "128", so it
> > > > is downsized from the 128x128 instead of taking the 16x16 icon
> > > > (that would show "16").
> > > > 
> > > > Has anyone any solution or played with this?
> > > > 
> > > > Wolfgang
> > 
> > 
> > 
> > --



-- 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web