×
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 - Adding missing translation link)
hamishwillee (Talk | contribs)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:Symbian C++]]
+
{{Archived|timestamp=20120223110740|user=roy.debjit| }}
[[Category:Known Issue]]
+
[[Category:Symbian C++]][[Category:Known Issue]][[Category:S60 3rd Edition FP2]][[Category:Graphics]][[Category:UI]]
[[Category:S60 3rd Edition, Feature Pack 2 ]]
+
{{Abstract|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.}}
[[Category:Graphics]]
+
[[Category:UI]]
+
__NOTOC__
+
__NOEDITSECTION__
+
{{KBKI}}
+
{{ArticleMetaData
+
|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
+
  
 +
{{ArticleMetaData <!-- v1.2 -->
 
|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 -->
 +
|id= KIS001171
 
}}
 
}}
 
==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==
 
==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:
 
 
<code cpp>
 
<code cpp>
 
  void CMyContainerControl::Draw( const TRect& aRect ) const
 
  void CMyContainerControl::Draw( const TRect& aRect ) const
Line 51: Line 49:
  
 
However, inverting the monochrome mask seems to produce correct results:
 
However, inverting the monochrome mask seems to produce correct results:
 
 
<code cpp>
 
<code cpp>
 
   gc.BitBltMasked(rect.iTl, iBitmapEColor16MU, rect, iMaskEGray2, '''ETrue''');
 
   gc.BitBltMasked(rect.iTl, iBitmapEColor16MU, rect, iMaskEGray2, '''ETrue''');
 
</code>
 
</code>
  
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 {{Icode|BitBltMasked()}} ({{Icode|aInvertMask}}) set to {{Icode|ETrue}}.
of <tt>BitBltMasked()</tt> (<tt>aInvertMask</tt>) set to <tt>ETrue</tt>.
+
 
 
<!-- Translation --> [[zh-hans:使用单色遮罩绘制图片得到正确结果]]
 
<!-- Translation --> [[zh-hans:使用单色遮罩绘制图片得到正确结果]]

Latest revision as of 09:02, 21 June 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}}.

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.

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 (21 Jun 2012)

[edit] 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.

[edit] 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.

This page was last modified on 21 June 2012, at 09:02.
61 page views in the last 30 days.