×
Namespaces

Variants
Actions
(Difference between revisions)

Archived:Drawing with monochrome masks may produce incorrect results on S60 3rd Edition FP2 (Known Issue)

From Nokia Developer Wiki
Jump to: navigation, search
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot change of template (Template:KnowledgeBase) - now using Template:ArticleMetaData)
hamishwillee (Talk | contribs)
m (Hamishwillee - Adding missing translation link)
Line 58: Line 58:
 
As a workaround for monochrome bitmaps, each mask could be inverted and drawn with the 5th parameter
 
As a workaround for monochrome bitmaps, each mask could be inverted and drawn with the 5th parameter
 
of <tt>BitBltMasked()</tt> (<tt>aInvertMask</tt>) set to <tt>ETrue</tt>.
 
of <tt>BitBltMasked()</tt> (<tt>aInvertMask</tt>) set to <tt>ETrue</tt>.
 +
<!-- Translation --> [[zh-hans:使用单色遮罩绘制图片得到正确结果]]

Revision as of 07:38, 16 December 2011

Template:KBKI

Article Metadata
Tested with
Devices(s): Reported against Nokia N85, Nokia N96
Compatibility
Platform(s): S60 3rd Edition, Feature Pack 2
S60 3rd Edition FP2
Article
Keywords: BitBltMasked, EGray2
Created: User:Technical writer 1 (11 Nov 2008)
Last edited: hamishwillee (16 Dec 2011)

Description

Drawing masked bitmaps using a monochrome (1 bit per pixel) bitmap as a mask may produce incorrect output on S60 3rd Edition, Feature Pack 2 devices.

How to reproduce

Create or load a bitmap (CFbsBitmap) with the same colour depth as the screen device (screen display mode, typically EColor16MU) and an accompanying monochrome bitmap (display mode EGray2) with the identical size.

Draw the bitmap using a masked blit as follows:

 void CMyContainerControl::Draw( const TRect& aRect ) const
{
CWindowGc& gc = SystemGc();
TRect rect( Rect() );
gc.BitBltMasked(rect.iTl, iBitmapEColor16MU, rect, iMaskEGray2, EFalse);
}

On some devices, such as the Nokia N85, the monochrome mask does not work correctly but displays vertical stripes instead.

Solution

This problem does not occur when using masks with the colour depth identical to the parent bitmap. However, this consumes significantly more RAM memory compared to using 1-bpp monochrome bitmaps.

However, inverting the monochrome mask seems to produce correct results:

   gc.BitBltMasked(rect.iTl, iBitmapEColor16MU, rect, iMaskEGray2, '''ETrue''');

As a workaround for monochrome bitmaps, each mask could be inverted and drawn with the 5th parameter of BitBltMasked() (aInvertMask) set to ETrue.

99 page views in the last 30 days.
×