Thread: Pocket Weather
View Single Post
  #72 (permalink)  
Old 12-02-2008, 06:20 PM
agraham's Avatar
agraham agraham is offline
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,068
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

The fuzziness I remarked on earlier of text drawn on the forelayer occurs however the text is drawn on the forelayer and affects both desktop and device and is ClearType related. However the problem wasn't where I was looking (at DrawString) as I was overlooking the obvious it is in the Form Paint event.

When a forelayer bitmap is enabled on a Form it is filled with a violet colour (you never see this) and that colour is set as transparent for that bitmap. When the form is told to paint itself it first draws the backlayer bitmap onto its background image and then draws the forelayer bitmap on top. Due to the transparency only non-violet pixels are actually drawn. What you see in the case of ClearTyped text, see the attached demo, is the anti-aliased pixels that are blended from the font colour and the nominally transparent violet colour. As they are now no longer transparent they get drawn on the background. Incidentally if you choose exactly that violet colour to draw on the forelayer you won't see anything as it will be treated as transparent.

Note this is NOT the same transparent colour that is specified when drawing an image on the forelayer, this one is used only internally when drawing the forelayer onto the background.

I don't know if this is the reason for the white pixel problem in Pocket Weather as I don't know exactly how it uses the forelayer but it is certainly the reason for the problem I noticed while I was developing ImageLibEx and couldn't explain at the time.
Reply With Quote