Print Page | Close Window

Bug: Images wrong when read from ImageList

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=22362
Printed Date: 29 April 2024 at 12:38am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Bug: Images wrong when read from ImageList
Posted By: gibra
Subject: Bug: Images wrong when read from ImageList
Date Posted: 15 July 2014 at 4:01am
Codejock 15.3.1

Strange behavior of the CommandBar: 
if I add in menu item an image taken from a ImageList (Common Controls 6.0) then it is that loading the same image from the same ImageList into a Form, image become corrupt.
Images attached shows the problem.

Below, is the code that I use to add item to menu:

With ControlFile.CommandBar.Controls
    Set Control = .Add(xtpControlButton, ID_16_AREE, "Aree commerciali")
    SetImageControlFromImageList CommandBars1, IML, "aree", ID_16_AREE
End With

This is the function to get image from ImageList:
Public Sub SetImageControlFromImageList(cmdbar As CommandBars, ByVal IML As Object, ByVal sKey As String, ByVal ControlID As Long)
    cmdbar.Icons.AddIcon IML.ListImages(sKey).ExtractIcon.Handle, ControlID, xtpImageNormal
End Sub

On ImageList, image is a 16x16 (only) ICO format, with 256 colors:



On Form_Load, set the icon form:
Me.Icon = IML.ListImages("aree").Picture


Image on menu is OK.


Same image loaded on Form is corrupt. Confused



Instead, if not load image on menu, image on Form is OK:





Note that the problem always occurs. Cry
 
Why this  behavior ? It's a bug?
There is a way to avoid this?

Thank. 


-------------
gibra
CJ SuiteControl v: 13.x to 19.x
Windows 10 64bit
VS2019 - VB6.0 SP6
<a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8



Replies:
Posted By: Willowmaster
Date Posted: 15 July 2014 at 5:25am
I tried too. See the zip. I commented out one line and then the form icon is correct. For some reason the commandbar seems to be able to find the right icon to show. Not sure if this will help you.

uploads/6226/FormImage.zip" rel="nofollow - uploads/6226/FormImage.zip

-------------
Product: Xtreme SuitePro (ActiveX) version 15.3.1

Platform: Windows XP (32bit) - SP 3 (on VMWare)

Language: Visual Basic 6.0





Posted By: gibra
Date Posted: 15 July 2014 at 8:33am
Thank for your reply.

But your project use different OCXs version:

Object={A8E5842E-102B-4289-9D57-3B3F5B5E15D3}#16.2#0; Codejock.Controls.Unicode.v16.2.4.ocx
Object={555E8FCC-830E-45CC-AF00-A012D5AE7451}#16.2#0; Codejock.CommandBars.Unicode.v16.2.4.ocx

therefore I can't try because of opening error.

Thank you, however.

Smile



-------------
gibra
CJ SuiteControl v: 13.x to 19.x
Windows 10 64bit
VS2019 - VB6.0 SP6
<a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8


Posted By: Willowmaster
Date Posted: 15 July 2014 at 9:13am
Just change it to the version you use. Or tell me which version you use and I'll try to fix the project. Smile

-------------
Product: Xtreme SuitePro (ActiveX) version 15.3.1

Platform: Windows XP (32bit) - SP 3 (on VMWare)

Language: Visual Basic 6.0





Posted By: gibra
Date Posted: 15 July 2014 at 11:45am
Originally posted by Willowmaster Willowmaster wrote:

Just change it to the version you use. Or tell me which version you use and I'll try to fix the project. Smile

As indicate on first message (first row) Codejock 15.3.1
Not Unicode version.

This is my pc at work.


EDIT:
I've see your project, but the problem is totally different.
Please re-read my first post, to better understand.

Thank.


-------------
gibra
CJ SuiteControl v: 13.x to 19.x
Windows 10 64bit
VS2019 - VB6.0 SP6
<a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8


Posted By: Willowmaster
Date Posted: 17 July 2014 at 4:48am
Can you supply a project which simulates the problem?

-------------
Product: Xtreme SuitePro (ActiveX) version 15.3.1

Platform: Windows XP (32bit) - SP 3 (on VMWare)

Language: Visual Basic 6.0





Posted By: gibra
Date Posted: 17 July 2014 at 9:26am
Originally posted by Willowmaster Willowmaster wrote:

Can you supply a project which simulates the problem?

uploads/4669/CommandBar_test.zip" rel="nofollow - uploads/4669/CommandBar_test.zip

Zip file contains also the icons used in the project (16x16 256 colors).

When you run the project, a messagebox will appear which contains instructions about how to replicate the problem.

Thank.



-------------
gibra
CJ SuiteControl v: 13.x to 19.x
Windows 10 64bit
VS2019 - VB6.0 SP6
<a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8


Posted By: Willowmaster
Date Posted: 17 July 2014 at 11:04am
Got it. Problem is clear now. I'll try later on to see if I can find a solution.

-------------
Product: Xtreme SuitePro (ActiveX) version 15.3.1

Platform: Windows XP (32bit) - SP 3 (on VMWare)

Language: Visual Basic 6.0





Posted By: gibra
Date Posted: 24 July 2014 at 11:49pm
Then is really a BUG... Shocked

-------------
gibra
CJ SuiteControl v: 13.x to 19.x
Windows 10 64bit
VS2019 - VB6.0 SP6
<a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8


Posted By: mcmastl
Date Posted: 15 April 2015 at 3:58pm
Hi Gibra, thank you for bringing this to our attention, we have informed our development team and we will be looking into the issue.  If the matter has been resolved please let us know. 

-------------
Luke McMasters, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: gibra
Date Posted: 18 April 2015 at 4:39am
After almost one year? LOL

I've already solved my self:

Public Sub SetImageControlFromImageList(cmdbar As CommandBars, ByVal IML As ImageList, ByVal sKey As String, ByVal ControlID As Long)
    'cmdbar.Icons.AddIcon IML.ListImages(sKey).ExtractIcon.Handle, ControlID, xtpImageNormal
    cmdbar.Icons.AddIcon IML.ListImages(sKey).Picture.Handle, ControlID, xtpImageNormal
End Sub
Thank Wink



-------------
gibra
CJ SuiteControl v: 13.x to 19.x
Windows 10 64bit
VS2019 - VB6.0 SP6
<a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net