Click here to Skip to main content
12,692,288 members (33,444 online)

Alain Rist - Professional Profile


    Blog RSS
No Biography provided
  • 22 Feb 2010: Best C++/MFC article of January 2010
  • 21 Oct 2009: Code Lean and Mean
  • 29 Nov 2007: Best C++/MFC article of November 2007


For more information on Reputation please see the FAQ.


Members need to achieve at least one of the given member levels in the given reputation categories in order to perform a given action. For example, to store personal files in your account area you will need to achieve Platinum level in either the Author or Authority category. The "If Owner" column means that owners of an item automatically have the privilege, and the given member types also gain the privilege regardless of their reputation level.

ActionAuthorAuthorityDebatorEditorEnquirerOrganiserParticipantIf OwnerMember Types
Have no restrictions on voting frequencysilversilversilversilverAdmin
Bypass spam checks when posting contentsilversilversilversilversilversilversilverSitebuilder, Subeditor, Mentor, Protector, Editor, Staff, Admin
Store personal files in your account areaplatinumplatinumSitebuilder, Subeditor, Supporter, Editor, Staff
Have live hyperlinks in your biographybronzebronzebronzebronzebronzebronzesilverSubeditor, Protector, Editor, Staff, Admin
Edit a Question in Q&AsilversilversilversilverYesSubeditor, Protector, Editor, Admin
Edit an Answer in Q&AsilversilversilversilverYesSubeditor, Protector, Editor, Admin
Delete a Question in Q&AYesSubeditor, Protector, Editor, Admin
Delete an Answer in Q&AYesSubeditor, Protector, Editor, Admin
Report an ArticlesilversilversilversilverSubeditor, Mentor, Protector, Editor, Staff, Admin
Approve/Disapprove a pending ArticlegoldgoldgoldgoldSubeditor, Mentor, Protector, Editor, Staff, Admin
Edit other members' articlesSubeditor, Protector, Editor, Admin
Create an article without requiring moderationplatinumSubeditor, Mentor, Protector, Editor, Staff, Admin
Approve/Disapprove a pending QuestionProtector, Admin
Approve/Disapprove a pending AnswerProtector, Admin
Report a forum messagesilversilverbronzeProtector, Editor, Admin
Approve/Disapprove a pending Forum MessageProtector, Admin
Create a new tagsilversilversilversilverAdmin
Modify a tagsilversilversilversilverAdmin

Actions with a green tick can be performed by this member.

GeneralUsing a single PNG resource for WinMobile apps [modified] Pin
Alain Rist19-Apr-09 21:58
memberAlain Rist19-Apr-09 21:58 
On[^] there is a discussion on using png images with alpha transparency on mobile devices.

This is what I use to build all the images needed at all sizes and resolutions from a single PNG resource. The PNG resource MUST be of type "GIF" D'Oh! | :doh: to be loaded by ::SHLoadImageResource().

Of course, requires WTL Smile | :)

More in my next CP Mobile article, don't ask me when Laugh | :laugh: .

inline HIMAGELIST AtlLoadImageList(UINT uID, int cy, UINT uFlags = ILC_COLOR32)
	// Load uID PNG image strip resource 
	CBitmap bmpOrig = ::SHLoadImageResource(ModuleHelper::GetResourceInstance(), uID);
	CSize sizeOrig;

	// Size to request
	INT n = /,
		cx = cy * n;
	CBitmap bmp;
	DRA::ImageList_StretchBitmap(bmpOrig, &bmp.m_hBitmap, cx, cy, n, 1);

	// Create ImageList
	CImageList iml;
	iml.Create(cx, cy, uFlags, n, 0);
	iml.Add(bmp.IsNull() ? bmpOrig : bmp);
	return iml;

Actually ::SHLoadImageResource() loads the PNG as a 16bits DIB (native DDB format), so alpha is lost before the call to DRA::ImageList_StretchBitmap().

This is not always a problem, as all with end up as a 16bits DDB on the device graphic chip, but it may be if we need further manipulations with transparency.

Soon coming my Image component which addresses that issue.


modified on Saturday, April 25, 2009 5:26 AM

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Advertise | Privacy | Mobile
Web02 | 2.8.170118.1 | Last Updated 18 Jan 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid