Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Bug: Images wrong when read from ImageList
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Bug: Images wrong when read from ImageList

 Post Reply Post Reply
Author
Message
gibra View Drop Down
Senior Member
Senior Member


Joined: 31 October 2008
Location: Italy
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibra Quote  Post ReplyReply Direct Link To This Post Topic: Bug: Images wrong when read from ImageList
    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
Back to Top
Willowmaster View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 July 2010
Location: Netherlands
Status: Offline
Points: 180
Post Options Post Options   Thanks (0) Thanks(0)   Quote Willowmaster Quote  Post ReplyReply Direct Link To This Post 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
Product: Xtreme SuitePro (ActiveX) version 15.3.1

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

Language: Visual Basic 6.0



Back to Top
gibra View Drop Down
Senior Member
Senior Member


Joined: 31 October 2008
Location: Italy
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibra Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Willowmaster View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 July 2010
Location: Netherlands
Status: Offline
Points: 180
Post Options Post Options   Thanks (0) Thanks(0)   Quote Willowmaster Quote  Post ReplyReply Direct Link To This Post 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



Back to Top
gibra View Drop Down
Senior Member
Senior Member


Joined: 31 October 2008
Location: Italy
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibra Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Willowmaster View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 July 2010
Location: Netherlands
Status: Offline
Points: 180
Post Options Post Options   Thanks (0) Thanks(0)   Quote Willowmaster Quote  Post ReplyReply Direct Link To This Post 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



Back to Top
gibra View Drop Down
Senior Member
Senior Member


Joined: 31 October 2008
Location: Italy
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibra Quote  Post ReplyReply Direct Link To This Post Posted: 17 July 2014 at 9:26am
Originally posted by Willowmaster Willowmaster wrote:

Can you supply a project which simulates the problem?


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
Back to Top
Willowmaster View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 July 2010
Location: Netherlands
Status: Offline
Points: 180
Post Options Post Options   Thanks (0) Thanks(0)   Quote Willowmaster Quote  Post ReplyReply Direct Link To This Post 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



Back to Top
gibra View Drop Down
Senior Member
Senior Member


Joined: 31 October 2008
Location: Italy
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibra Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
mcmastl View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 April 2015
Status: Offline
Points: 79
Post Options Post Options   Thanks (0) Thanks(0)   Quote mcmastl Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
gibra View Drop Down
Senior Member
Senior Member


Joined: 31 October 2008
Location: Italy
Status: Offline
Points: 288
Post Options Post Options   Thanks (1) Thanks(1)   Quote gibra Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.234 seconds.