![]() |
Load images from resource file into ImageManager |
Post Reply ![]() |
Author | |
kandylion ![]() Newbie ![]() Joined: 05 February 2007 Status: Offline Points: 5 |
![]() ![]() ![]() ![]() ![]() Posted: 08 February 2007 at 9:05am |
Hi,
Is it possible to load images from a resource file (*.resx) into ImageManager at runtime?
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
kandylion ![]() Newbie ![]() Joined: 05 February 2007 Status: Offline Points: 5 |
![]() ![]() ![]() ![]() ![]() |
Thanks for the quick response.
Very impressed with your service.
|
|
![]() |
|
kandylion ![]() Newbie ![]() Joined: 05 February 2007 Status: Offline Points: 5 |
![]() ![]() ![]() ![]() ![]() |
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.
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi, Convert this Image to Bitmap and use Addbitmap method.
What code you use to load Image?
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
kandylion ![]() Newbie ![]() Joined: 05 February 2007 Status: Offline Points: 5 |
![]() ![]() ![]() ![]() ![]() |
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.
|
|
![]() |
|
Pieter2008 ![]() Newbie ![]() Joined: 17 February 2009 Status: Offline Points: 1 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |