Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Docking Pane
  New Posts New Posts RSS Feed - Icon Size
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Icon Size

 Post Reply Post Reply
Author
Message
robs View Drop Down
Groupie
Groupie


Joined: 09 November 2003
Status: Offline
Points: 84
Post Options Post Options   Thanks (0) Thanks(0)   Quote robs Quote  Post ReplyReply Direct Link To This Post Topic: Icon Size
    Posted: 03 December 2003 at 12:01am

Docking Pane 8.6 ActiveX:

I am using AddIconHandle to load an icon from a resource file. The icon is 16x16 only. The icon gets displayed as 32x32 on the pane.

Any ideas?

 

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 09 December 2003 at 1:49am
How do you load the icons?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
robs View Drop Down
Groupie
Groupie


Joined: 09 November 2003
Status: Offline
Points: 84
Post Options Post Options   Thanks (0) Thanks(0)   Quote robs Quote  Post ReplyReply Direct Link To This Post Posted: 09 December 2003 at 6:08am

Oleg,

Dim p As IPictureDisp
Set p = LoadResPicture(101, 1)
DockingManager.AddIconHandle p.Handle, UID

Dim DockingPaneAs XtremeDockingPane.pane

Set DockingPane = DockingManager.CreatePane(UID, cx, cy, dockingDirection, Nothing)

Back to Top
robs View Drop Down
Groupie
Groupie


Joined: 09 November 2003
Status: Offline
Points: 84
Post Options Post Options   Thanks (0) Thanks(0)   Quote robs Quote  Post ReplyReply Direct Link To This Post Posted: 30 December 2003 at 2:22pm

I think I narowed this down to be an issue with the resource editor in VB. Sorry, this is also a double post.

When using LoadResPicture in VB, it seems to always load icons 32X32 pixels, which looks ugly on the docking panes.

I've had luck resizing the icons using code such as:

Private Declare Function CopyImage Lib "user32" (ByVal handle As Long, ByVal imageType As Long, ByVal newWidth As Long, ByVal newHeight As Long, ByVal lFlags As Long) As Long

Private Cons IMAGE_ICON=2

Private Const LR_COPYFROMRESOURCE =3

   Dim p As stdole.IPictureDisp
   Set p = LoadResPicture(101, 1)
   Dim l As Long
   l = CopyImage(p.handle, IMAGE_ICON, 16, 16, LR_COPYFROMRESOURCE)

  DockingPane.AddIconHandle (l,ID)

The code above will resize the icon in the resource file to 16X16.

 

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.266 seconds.