![]() |
32bit png display using CXTPSkinImage |
Post Reply
|
| Author | |
winrive
Newbie
Joined: 16 April 2008 Location: Korea, South Status: Offline Points: 3 |
Post Options
Thanks(0)
Quote Reply
Topic: 32bit png display using CXTPSkinImagePosted: 25 April 2008 at 1:19am |
|
I want to display background of control(or window) using CXTPSkinImage. below is my code. CXTPSkinImage m_BKImage; BOOL bIsAlpha = TRUE; HBITMAP hBitmap = CXTPImageManagerIcon::LoadBitmapFromResource( MAKEINTRESOURCE(nResourceID), &bIsAlpha ); m_BKImage.SetBitmap( hBitmap, bIsAlpha ); CXTPClientRect rcClient(this); dc.FillSolidRect( &rcClient, RGB(0,0,0) ); CSize sizeImage = CSize( m_BKImage.GetWidth(), m_BKImage.GetHeight() ); m_BKImage.DrawImage( &dc, rcClient, CRect(0,0,sizeImage.cx,sizeImage.cy), CRect(0,0,0,0), ST_TRUESIZE, TRUE ); but i got strange result some parts of image are strange( see white area in b) ) ![]() a) in photoshop
![]() b) result
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 25 April 2008 at 6:20am |
|
Use ImageManager instead. XTPImageManager()->SetIcons(....);
XTPImageManager()->GetIcon(1)->Draw(...);
or Premultiply bitmap for SkinImage:
hBitmap = CXTPImageManagerIcon::PreMultiplyAlphaBitmap(hBmp, &m_bAlpha);
DeleteObject(hBmp);
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
winrive
Newbie
Joined: 16 April 2008 Location: Korea, South Status: Offline Points: 3 |
Post Options
Thanks(0)
Quote Reply
Posted: 27 April 2008 at 7:43pm |
|
It works good
Thanks a lot.
Could you let me know another better apporach for dispalying alpha png for background?
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 28 April 2008 at 12:43am |
|
As I worte better use some XTPImageManager. You can create some instance for your buttons:
m_pImageManager = new CXTPImageManager();
m_pImageManager->SetIcons(...);
...
m_pImageManager()->GetImage(x)->Draw(...);
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
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 |