Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Png loaded from a file
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Png loaded from a file

 Post Reply Post Reply
Author
Message
himanshu View Drop Down
Groupie
Groupie


Joined: 04 January 2008
Status: Offline
Points: 81
Post Options Post Options   Thanks (0) Thanks(0)   Quote himanshu Quote  Post ReplyReply Direct Link To This Post Topic: Png loaded from a file
    Posted: 26 March 2008 at 5:09am
HI
 
I have loaded the png for a button usiing following code in my project
 
HBITMAP hBitmap = CXTPImageManagerIcon::LoadBitmapFromFile(_T("E:\\res\\xyz2_16.png") );
CBitmap* pBitmap = CBitmap::FromHandle(hBitmap);
pCommandBars->GetImageManager()->SetIcons(*pBitmap, uiGroupClipboard, _countof(uiGroupClipboard), CSize(16, 16));
 
Now i have another application where i loaded the same png image by using different tool other than codejock.
The two images look differently .The one which is loaded using codejock shows large differences with the original.
 
I am attaching the both images along with the original one.
Could you suggest some way to improve the look of this png file closer to the original one.
 
 
I am getting error that only users with sufficient permission can upload?? But iIn recent time i was able to do the same.
 
 
Thanks
 
 
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 March 2008 at 5:15am
to free resources better use
 
CBitmap Bitmap; Bitmap.Attach(hBitmap);
pCommandBars->GetImageManager()->SetIcons(&Bitmap, uiGroupClipboard, _countof(uiGroupClipboard), CSize(16, 16));
 
 
Send it to support.codejock.com
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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 March 2008 at 5:17am
btw.... if image has alpha layer, you have to set last parameter bAlpah = TRUE;
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
himanshu View Drop Down
Groupie
Groupie


Joined: 04 January 2008
Status: Offline
Points: 81
Post Options Post Options   Thanks (0) Thanks(0)   Quote himanshu Quote  Post ReplyReply Direct Link To This Post Posted: 27 March 2008 at 12:39am
thanks
it did worked
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.047 seconds.