Print Page | Close Window

Transparent PNG image on Pushbutton

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Suite Pro
Forum Description: Topics Related to Codejock Suite Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=7443
Printed Date: 28 September 2024 at 3:23am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Transparent PNG image on Pushbutton
Posted By: ikaney
Subject: Transparent PNG image on Pushbutton
Date 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.



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


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



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