Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Suite Pro
  New Posts New Posts RSS Feed - Transparent PNG image on Pushbutton
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Transparent PNG image on Pushbutton

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


Joined: 15 June 2007
Location: United Kingdom
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote ikaney Quote  Post ReplyReply Direct Link To This Post Topic: Transparent PNG image on Pushbutton
    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.
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: 26 June 2007 at 1:48am

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
Back to Top
ideafix View Drop Down
Newbie
Newbie
Avatar

Joined: 12 March 2009
Location: Portugal
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote ideafix Quote  Post ReplyReply Direct Link To This Post Posted: 20 October 2010 at 9:33am
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!
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.234 seconds.