Click here to Skip to main content
15,074,942 members

Alain Rist - Professional Profile



Summary

    Blog RSS
25,461
Author
7,458
Authority
276
Debator
253
Editor
8
Enquirer
515
Organiser
1,502
Participant
No Biography provided

Reputation

Weekly Data. Recent events may not appear immediately. For information on Reputation please see the FAQ.

Privileges

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. The member types column lists member types who gain the privilege regardless of their reputation level.

ActionAuthorAuthorityDebatorEditorEnquirerOrganiserParticipantIf OwnerMember Types
Have no restrictions on voting frequencysilversilversilversilver
Bypass spam checks when posting contentsilversilversilversilversilversilvergoldSubEditor, Mentor, Protector, Editor
Store personal files in your account areaplatinumplatinumSubEditor, Editor
Have live hyperlinks in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Have the ability to include a biography in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Edit a Question in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Edit an Answer in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Delete a Question in Q&AYesSubEditor, Protector, Editor
Delete an Answer in Q&AYesSubEditor, Protector, Editor
Report an ArticlesilversilversilversilverSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending ArticlegoldgoldgoldgoldSubEditor, Mentor, Protector, Editor
Edit other members' articlesSubEditor, Protector, Editor
Create an article without requiring moderationplatinumSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending QuestionProtector
Approve/Disapprove a pending AnswerProtector
Report a forum messagesilversilverbronzeProtector, Editor
Approve/Disapprove a pending Forum MessageProtector
Create a new tagsilversilversilversilver
Modify a tagsilversilversilversilver

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 20:58
MemberAlain Rist19-Apr-09 20:58 
On http://nativemobile.blogspot.com/[^] 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);
	ATLASSERT(!bmpOrig.IsNull());
	CSize sizeOrig;
	bmpOrig.GetSize(sizeOrig);

	// Size to request
	INT n = sizeOrig.cx / sizeOrig.cy,
		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.

cheers,
AR

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.