Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Load images from resource file into ImageManager
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Load images from resource file into ImageManager

 Post Reply Post Reply
Author
Message
kandylion View Drop Down
Newbie
Newbie


Joined: 05 February 2007
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote kandylion Quote  Post ReplyReply Direct Link To This Post Topic: Load images from resource file into ImageManager
    Posted: 08 February 2007 at 9:05am
Hi,
Is it possible to load images from a resource file (*.resx) into ImageManager at runtime?
 
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: 08 February 2007 at 11:52am
Hi,
 
Something like this:
 

System.Drawing.Icon icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));

CommandBars.Icons.AddIcon(icon.Handle.ToInt32(), ID.ID_APP_ABOUT, XtremeCommandBars.XTPImageState.xtpImageNormal);

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
kandylion View Drop Down
Newbie
Newbie


Joined: 05 February 2007
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote kandylion Quote  Post ReplyReply Direct Link To This Post Posted: 08 February 2007 at 1:45pm
Thanks for the quick response.
Very impressed with your service.
Back to Top
kandylion View Drop Down
Newbie
Newbie


Joined: 05 February 2007
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote kandylion Quote  Post ReplyReply Direct Link To This Post Posted: 09 February 2007 at 5:18am
Is there anyway of doing this with an Image? I noticed that it is not possible to get a handle or pointer to an image loaded via the resource file. It would be great if this were possible.
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 February 2007 at 6:09am

Hi,

Convert this Image to Bitmap and use Addbitmap method.
What code you use to load Image?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
kandylion View Drop Down
Newbie
Newbie


Joined: 05 February 2007
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote kandylion Quote  Post ReplyReply Direct Link To This Post Posted: 09 February 2007 at 7:47am
Hi,
Something like this...
 
<code>

ImageList myImages =  new ImageList(this.components);

myImages.Images.Add(global::UITest1.MainClass.Image1);

myImages.Images.Add(global::UITest1.MainClass.Image2);

myImages.Images.Add(global::UITest1.MainClass.Image3);

</code>
 
This ImageList is used in other parts of the UI. Ideally, I would like minimal disruption to the code and so would like to load the images from this imagelist into the ImageManager so that the CodeJock UI can be updated indepentandly of the other section.
 
At present, my solution has been to load the images into ImageManager at design time (thereby creating two objects with the same images: ImageList and ImageManager). It is also not possible to use the ImageManager as the primary source of images as the other section does not reference the CodeJock libraries and I would like to keep it that way.
 
I hope that this is clear to you!
 
Any help would be appreciated.
Back to Top
Pieter2008 View Drop Down
Newbie
Newbie


Joined: 17 February 2009
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote Pieter2008 Quote  Post ReplyReply Direct Link To This Post Posted: 17 February 2009 at 3:45am
   Dim x As Bitmap
   x = My.Resources.myIcon
   frmMain.ImageManager.Icons.AddBitmap(CInt(x.GetHbitmap), 25, XtremeCommandBars.XTPImageState.xtpImageNormal, True)
   'where myIcon is the icon and 25 is the ID used in my Imagemanager
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.141 seconds.