![]() |
Using PNG with CXTButton? |
Post Reply
|
| Author | |
loqqus
Newbie
Joined: 22 August 2006 Status: Offline Points: 3 |
Post Options
Thanks(0)
Quote Reply
Topic: Using PNG with CXTButton?Posted: 24 August 2006 at 4:40am |
|
Is it possible to use a PNG with CXTButton instead of a bmp or ico? For example, in the Button Sample project, replace the bmps with pngs.
If so, which member fn should I call, or do I need to convert the png to bmp? |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 24 August 2006 at 8:54am |
|
Hi,
Add Png file ro resources, load it
BOOL bAlphaBitmap = FALSE;
HBITMAP hBitmap = CXTPImageManagerIcon::LoadBitmapFromResource(MAKEINTRESOURCE(nID), &bAlphaBitmap); CXTPImageManagerIconHandle hIconHandle;
hIconHandle = hBitmap; // Will call DeleteObject;
and call
btn.SetIcon(size, hIconHandle, CXTPImageManagerIconHandle(), TRUE);
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
loqqus
Newbie
Joined: 22 August 2006 Status: Offline Points: 3 |
Post Options
Thanks(0)
Quote Reply
Posted: 25 August 2006 at 12:18am |
|
Perfect! Works great -- Many thanks!
|
|
![]() |
|
Hmbucker
Newbie
Joined: 12 October 2012 Status: Offline Points: 2 |
Post Options
Thanks(0)
Quote Reply
Posted: 12 October 2012 at 4:00am |
|
That shows the png alright, but it looses the skinning of the button???
So I guess the only possible solution is to derive a button call CButton::OnPaint(); and then draw your own png right? A bit a pity though, as I would expect such an expensive tool to do that for 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 |