LoadResPicture 16x16 
Author Message
 LoadResPicture 16x16

I have saved 16x16 icons in a resource file, but when I
try to get them back using the LoadResPicture I always get
a 32x32 format icon back!.

Does anyone know how I can get a 16x16 format icon from
the resource file, or how can I resize this Icon from a
32x32 to a 16x16 without cropping?

Thanx in advance

Graham Bell



Tue, 01 Feb 2005 21:24:47 GMT  
 LoadResPicture 16x16
On Fri, 16 Aug 2002 06:24:47 -0700, "Graham Bell"

Quote:

>I have saved 16x16 icons in a resource file, but when I
>try to get them back using the LoadResPicture I always get
>a 32x32 format icon back!.

>Does anyone know how I can get a 16x16 format icon from
>the resource file, or how can I resize this Icon from a
>32x32 to a 16x16 without cropping?

>Thanx in advance

>Graham Bell

This sounds like the VB icon bug rearing it's ugly head.  You might
want to have a look at the Form Icon Bug Fix demo at
http://www.mvps.org/vbvision/

HTH,
Bryan
____________________________________________________________
New Vision Software            "When the going gets weird,"
Bryan Stafford                   "the weird turn pro."

Microsoft MVP-Visual Basic     Fear and Loathing in LasVegas



Wed, 02 Feb 2005 00:02:41 GMT  
 LoadResPicture 16x16
Hi Bryan,

Although the Bug Fix Demo shows ways of loading an Icon
using the API it does not solve my original problem. Here
is some sample code:

I have one icon Test_16.ico in my App directory and a copy
of the same icon in my Resource file.

These two statements SHOULD result in the same Icon being
retrieved.

    oImageList.ListImages.Add , "One", LoadPicture
(App.Path & "\test_16.ico")

    oImageList.ListImages.Add , "Two", LoadResPicture
(1016, 1)

The first works correctly an retrieves a 16x16 icon. The
second retrieves a 32x32 icon containing the expanded
16x16 icon.

If I try to use this icon as a 16x16 I get a cropped
version.

I think I will have to use the first version and load the
icon from the App directory at run time.

Anyway thanx for yor interest in my problem.

Quote:
>-----Original Message-----
>On Fri, 16 Aug 2002 06:24:47 -0700, "Graham Bell"

>>I have saved 16x16 icons in a resource file, but when I
>>try to get them back using the LoadResPicture I always
get
>>a 32x32 format icon back!.

>>Does anyone know how I can get a 16x16 format icon from
>>the resource file, or how can I resize this Icon from a
>>32x32 to a 16x16 without cropping?

>>Thanx in advance

>>Graham Bell

>This sounds like the VB icon bug rearing it's ugly head.  
You might
>want to have a look at the Form Icon Bug Fix demo at
>http://www.mvps.org/vbvision/

>HTH,
>Bryan
>__________________________________________________________
__
>New Vision Software            "When the going gets
weird,"
>Bryan Stafford                       "the weird turn pro."

>Microsoft MVP-Visual Basic     Fear and Loathing in
LasVegas
>.



Fri, 04 Feb 2005 20:09:24 GMT  
 LoadResPicture 16x16
The point is that you can use the API to load the icon and avoid the
icon mangling provided by LoadResPicture.

HTH,
Bryan
____________________________________________________________
New Vision Software            "When the going gets weird,"
Bryan Stafford                   "the weird turn pro."

Microsoft MVP-Visual Basic     Fear and Loathing in LasVegas

On Mon, 19 Aug 2002 05:09:24 -0700, "Graham"

Quote:

>Hi Bryan,

>Although the Bug Fix Demo shows ways of loading an Icon
>using the API it does not solve my original problem. Here
>is some sample code:

>I have one icon Test_16.ico in my App directory and a copy
>of the same icon in my Resource file.

>These two statements SHOULD result in the same Icon being
>retrieved.

>    oImageList.ListImages.Add , "One", LoadPicture
>(App.Path & "\test_16.ico")

>    oImageList.ListImages.Add , "Two", LoadResPicture
>(1016, 1)

>The first works correctly an retrieves a 16x16 icon. The
>second retrieves a 32x32 icon containing the expanded
>16x16 icon.

>If I try to use this icon as a 16x16 I get a cropped
>version.

>I think I will have to use the first version and load the
>icon from the App directory at run time.

>Anyway thanx for yor interest in my problem.

>>-----Original Message-----
>>On Fri, 16 Aug 2002 06:24:47 -0700, "Graham Bell"

>>>I have saved 16x16 icons in a resource file, but when I
>>>try to get them back using the LoadResPicture I always
>get
>>>a 32x32 format icon back!.

>>>Does anyone know how I can get a 16x16 format icon from
>>>the resource file, or how can I resize this Icon from a
>>>32x32 to a 16x16 without cropping?

>>>Thanx in advance

>>>Graham Bell

>>This sounds like the VB icon bug rearing it's ugly head.  
>You might
>>want to have a look at the Form Icon Bug Fix demo at
>>http://www.mvps.org/vbvision/

>>HTH,
>>Bryan
>>__________________________________________________________
>__
>>New Vision Software            "When the going gets
>weird,"
>>Bryan Stafford                   "the weird turn pro."

>>Microsoft MVP-Visual Basic     Fear and Loathing in
>LasVegas
>>.



Fri, 04 Feb 2005 22:31:42 GMT  
 LoadResPicture 16x16
Ok I take your point, shame that Microsoft has no time to
fix these small bugs.

Thanx for your help.

Graham

Quote:
>-----Original Message-----
>The point is that you can use the API to load the icon
and avoid the
>icon mangling provided by LoadResPicture.

>HTH,
>Bryan
>__________________________________________________________
__
>New Vision Software            "When the going gets
weird,"
>Bryan Stafford                       "the weird turn pro."

>Microsoft MVP-Visual Basic     Fear and Loathing in
LasVegas

>On Mon, 19 Aug 2002 05:09:24 -0700, "Graham"

>>Hi Bryan,

>>Although the Bug Fix Demo shows ways of loading an Icon
>>using the API it does not solve my original problem.
Here
>>is some sample code:

>>I have one icon Test_16.ico in my App directory and a
copy
>>of the same icon in my Resource file.

>>These two statements SHOULD result in the same Icon
being
>>retrieved.

>>    oImageList.ListImages.Add , "One", LoadPicture
>>(App.Path & "\test_16.ico")

>>    oImageList.ListImages.Add , "Two", LoadResPicture
>>(1016, 1)

>>The first works correctly an retrieves a 16x16 icon. The
>>second retrieves a 32x32 icon containing the expanded
>>16x16 icon.

>>If I try to use this icon as a 16x16 I get a cropped
>>version.

>>I think I will have to use the first version and load
the
>>icon from the App directory at run time.

>>Anyway thanx for yor interest in my problem.

>>>-----Original Message-----
>>>On Fri, 16 Aug 2002 06:24:47 -0700, "Graham Bell"

>>>>I have saved 16x16 icons in a resource file, but when
I
>>>>try to get them back using the LoadResPicture I always
>>get
>>>>a 32x32 format icon back!.

>>>>Does anyone know how I can get a 16x16 format icon
from
>>>>the resource file, or how can I resize this Icon from
a
>>>>32x32 to a 16x16 without cropping?

>>>>Thanx in advance

>>>>Graham Bell

>>>This sounds like the VB icon bug rearing it's ugly
head.  
>>You might
>>>want to have a look at the Form Icon Bug Fix demo at
>>>http://www.mvps.org/vbvision/

>>>HTH,
>>>Bryan
>>>________________________________________________________
__
>>__
>>>New Vision Software            "When the going gets
>>weird,"
>>>Bryan Stafford                       "the weird turn pro."

Thompson -

>>>Microsoft MVP-Visual Basic     Fear and Loathing in
>>LasVegas
>>>.

>.



Sat, 05 Feb 2005 15:46:16 GMT  
 LoadResPicture 16x16
There is a workaround:

'### Add the icon to the imagelist
oImageList.ListImages.Add , "Two", LoadResPicture(1016, 1)

'### Use the .ExtractIcon from the image list instead
'### of .Picture - This gets the correct size icon 16x16
SSActiveToolBars1.Tools("ID_Tool6").Picture =
oImageList.ListImages("Two").ExtractIcon

Graham

Quote:
>-----Original Message-----
>Ok I take your point, shame that Microsoft has no time to
>fix these small bugs.

>Thanx for your help.

>Graham
>>-----Original Message-----
>>The point is that you can use the API to load the icon
>and avoid the
>>icon mangling provided by LoadResPicture.

>>HTH,
>>Bryan
>>_________________________________________________________
_
>__
>>New Vision Software            "When the going gets
>weird,"
>>Bryan Stafford                   "the weird turn pro."

>>Microsoft MVP-Visual Basic     Fear and Loathing in
>LasVegas

>>On Mon, 19 Aug 2002 05:09:24 -0700, "Graham"

>>>Hi Bryan,

>>>Although the Bug Fix Demo shows ways of loading an Icon
>>>using the API it does not solve my original problem.
>Here
>>>is some sample code:

>>>I have one icon Test_16.ico in my App directory and a
>copy
>>>of the same icon in my Resource file.

>>>These two statements SHOULD result in the same Icon
>being
>>>retrieved.

>>>    oImageList.ListImages.Add , "One", LoadPicture
>>>(App.Path & "\test_16.ico")

>>>    oImageList.ListImages.Add , "Two", LoadResPicture
>>>(1016, 1)

>>>The first works correctly an retrieves a 16x16 icon.
The
>>>second retrieves a 32x32 icon containing the expanded
>>>16x16 icon.

>>>If I try to use this icon as a 16x16 I get a cropped
>>>version.

>>>I think I will have to use the first version and load
>the
>>>icon from the App directory at run time.

>>>Anyway thanx for yor interest in my problem.

>>>>-----Original Message-----
>>>>On Fri, 16 Aug 2002 06:24:47 -0700, "Graham Bell"

>>>>>I have saved 16x16 icons in a resource file, but when
>I
>>>>>try to get them back using the LoadResPicture I
always
>>>get
>>>>>a 32x32 format icon back!.

>>>>>Does anyone know how I can get a 16x16 format icon
>from
>>>>>the resource file, or how can I resize this Icon from
>a
>>>>>32x32 to a 16x16 without cropping?

>>>>>Thanx in advance

>>>>>Graham Bell

>>>>This sounds like the VB icon bug rearing it's ugly
>head.  
>>>You might
>>>>want to have a look at the Form Icon Bug Fix demo at
>>>>http://www.mvps.org/vbvision/

>>>>HTH,
>>>>Bryan
>>>>_______________________________________________________
_
>__
>>>__
>>>>New Vision Software            "When the going gets
>>>weird,"
>>>>Bryan Stafford                   "the weird turn
pro."

>Thompson -

>>>>Microsoft MVP-Visual Basic     Fear and Loathing in
>>>LasVegas
>>>>.

>>.

>.



Sat, 05 Feb 2005 16:19:24 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. VB6.LoadResPicture

2. LoadResPicture in a API call?

3. Trouble with LoadresPicture

4. LoadResPicture Bug

5. LoadResPicture into Image instead of StdPicture or Picture??

6. Possible to extract a specific icon from LoadResPicture?

7. LoadResPicture problem in VB4 - GDI Resources

8. Resource File - LoadResPicture

9. LoadResPicture into Image instead of StdPicture or Picture??

10. LoadResPicture

11. LoadResData / LoadResPicture : Problems with resource files

12. Overcoming the LoadResPicture Icon bug in VB5

 

 
Powered by phpBB® Forum Software