Transparent PNG image on Pushbutton |
Post Reply |
Author | |
ikaney
Newbie Joined: 15 June 2007 Location: United Kingdom Status: Offline Points: 14 |
Post Options
Thanks(0)
Posted: 25 June 2007 at 10:34am |
I've been attempting for a while to get a transparent PNG image placed onto the codejock pushbutton control without much success.
I get the nasty grey background where the image has been placed. The typical code I'm using is the following:
control.Picture = System.Drawing.Image.FromStream(GetResource("pretty_png.png"))
This doesn't seem to import the image correctly as the stock Windows Forms button does.
Is there something I'm missing? I've checked the help and I've searched the forums and found references to LoadBitmapFromResource and various other items, but these examples all seem to be non VB.NET related and I'm having a hard time breaking it down from the C++, etc code that's shown.
Thanks in advance for any help.
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi, This code works for me:
Stream imageStream = assembly.GetManifestResourceStream("WindowsApplication5.AlphaHelp.png");
Bitmap bmp = new Bitmap(imageStream); XtremeSuiteControls.SuiteControlsGlobalSettings gs = new XtremeSuiteControls.SuiteControlsGlobalSettings(); gs.Icons.AddBitmap(bmp.GetHbitmap().ToInt32(), 1, XtremeSuiteControls.XTPImageState.xtpImageNormal, true); axPushButton1.Icon = gs.Icons.GetImage(1, 0); |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
ideafix
Newbie Joined: 12 March 2009 Location: Portugal Status: Offline Points: 4 |
Post Options
Thanks(0)
|
Hi Oleg
I have already tryed the code "translated" to vb.net but still appears a grey background. Is there any way to remove the grey background? I've tried load *.ico files and *.png files, but always appears the Grey Background...
Pelase help me!
|
|
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 |