Print Page | Close Window

Icon Size

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=263
Printed Date: 15 May 2024 at 1:39am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Icon Size
Posted By: robs
Subject: Icon Size
Date 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?

 




Replies:
Posted By: Oleg
Date Posted: 09 December 2003 at 1:49am
How do you load the icons?

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: robs
Date 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)



Posted By: robs
Date 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.

 




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