×
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
debjit.roy (Talk | contribs)
(Debjit.roy -)
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot update - Fix Article Metadata and other minor issues)
Line 1: Line 1:
[[Category:Symbian C++]][[Category:Known Issue]][[Category:S60 3rd Edition, Feature Pack 2]][[Category:Graphics]][[Category:UI]]
+
[[Category:Symbian C++]][[Category:Known Issue]][[Category:S60 3rd Edition FP2]][[Category:Graphics]][[Category:UI]]
 
__NOTOC__
 
__NOTOC__
 
__NOEDITSECTION__
 
__NOEDITSECTION__
 
{{KBKI}}
 
{{KBKI}}
{{ArticleMetaData
+
{{ArticleMetaData <!-- v1.2 -->
|id=KIS001171
+
|platform=S60 3rd Edition, Feature Pack 2
+
|devices=Reported against Nokia N85, Nokia N96
+
|category=Symbian C++
+
|subcategory=Graphics, UI
+
|creationdate=November 11, 2008
+
|keywords=BitBltMasked, EGray2
+
 
+
 
|sourcecode= <!-- Link to example source code (e.g. [[Media:The Code Example ZIP.zip]]) -->
 
|sourcecode= <!-- Link to example source code (e.g. [[Media:The Code Example ZIP.zip]]) -->
 
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
 
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
|sdk=<!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) -->
+
|devices= Reported against Nokia N85, Nokia N96
|devicecompatability=<!-- Compatible devices (e.g.: All* (must have GPS) ) -->
+
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) -->
|signing=<!-- Empty or one of Self-Signed, DevCert, Manufacturer -->
+
|platform= S60 3rd Edition, Feature Pack 2
|capabilities=<!-- Capabilities required (e.g. Location, NetworkServices.) -->
+
|devicecompatability= <!-- Compatible devices (e.g.: All* (must have GPS) ) -->
|author=[[User:Technical writer 1]]
+
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
 +
|signing= <!-- Empty or one of Self-Signed, DevCert, Manufacturer -->
 +
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
 +
|keywords= BitBltMasked, EGray2
 +
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
 +
|translated-by= <!-- [[User:XXXX]] -->
 +
|translated-from-title= <!-- Title only -->
 +
|translated-from-id= <!-- Id of translated revision -->
 +
|review-by= <!-- After re-review: [[User:username]] -->
 +
|review-timestamp= <!-- After re-review: YYYYMMDD -->
 +
|update-by= <!-- After significant update: [[User:username]]-->
 +
|update-timestamp= <!-- After significant update: YYYYMMDD -->
 +
|creationdate= 20081111
 +
|author= [[User:Technical writer 1]]
 +
<!-- The following are not in current metadata -->
 +
|subcategory= Graphics, UI
 +
|id= KIS001171
 
}}
 
}}
 
{{Archived|timestamp=20120223110740|user=roy.debjit| }}
 
{{Archived|timestamp=20120223110740|user=roy.debjit| }}
Line 27: Line 35:
 
==How to reproduce==
 
==How to reproduce==
  
Create or load a bitmap (<tt>CFbsBitmap</tt>) with the same colour depth as the screen device (screen display mode, typically <tt>EColor16MU</tt>) and an accompanying monochrome bitmap (display mode <tt>EGray2</tt>) with the identical size.
+
Create or load a bitmap ({{Icode|CFbsBitmap}}) with the same colour depth as the screen device (screen display mode, typically {{Icode|EColor16MU}}) and an accompanying monochrome bitmap (display mode {{Icode|EGray2}}) with the identical size.
  
 
Draw the bitmap using a masked blit as follows:
 
Draw the bitmap using a masked blit as follows:
Line 53: Line 61:
  
 
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 {{Icode|BitBltMasked()}} ({{Icode|aInvertMask}}) set to {{Icode|ETrue}}.
 
<!-- Translation --> [[zh-hans:使用单色遮罩绘制图片得到正确结果]]
 
<!-- Translation --> [[zh-hans:使用单色遮罩绘制图片得到正确结果]]

Revision as of 08:15, 24 February 2012

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 (24 Feb 2012)

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

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.

90 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×