Print Page | Close Window

Load images from resource file into ImageManager

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=6352
Printed Date: 07 October 2024 at 6:21am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Load images from resource file into ImageManager
Posted By: kandylion
Subject: Load images from resource file into ImageManager
Date Posted: 08 February 2007 at 9:05am
Hi,
Is it possible to load images from a resource file (*.resx) into ImageManager at runtime?
 



Replies:
Posted By: Oleg
Date 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


Posted By: kandylion
Date Posted: 08 February 2007 at 1:45pm
Thanks for the quick response.
Very impressed with your service.


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


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


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


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



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