Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Basic4ppc Wishlist > Bug Reports
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Bug Reports Post about errors or bugs encountered.

Forelayer text colour and weight!

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-08-2008, 10:45 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default Forelayer text colour and weight!

Using the Imagelib library if I run this code on my desktop (version 6.42) both compiled and in the IDE the text drawn by ForeDrawer and Form1.FDrawString is heavier (bolder) than that drawn by BackDrawer and Form1.DrawString. The colours are also noticeably different although supposedly the same. It is not a scaling problem as the text sizes are the same.

If I run this code on my device (version 6.41) both optimised compiled and in the device IDE the text drawn by ForeDrawer is heavier (bolder) than that drawn by BackDrawer. As on the desktop the colours are also noticeably different in the same way and the text sizes are the same. However the text that is supposed to be drawn by both Form1.FDrawString and Form1.DrawString is not displayed at all!

I cannot explain this. Am I being stupid and missing something obvious or is there a problem?
Code:
Sub App_Start
    Form1.Show
    col = cGreen
    Form1.ForeLayer = 
True
    ForeDrawer.New1(
"Form1"True)
    BackDrawer.New1(
"Form1"False)
    Brush.New1(col)
    ForeDrawer.DrawString1(
"A string",20, Brush.Value, 00)
    BackDrawer.DrawString1(
"A string",20, Brush.Value, 030)
    Form1.FDrawString(
"A string",20060,200,60, col)
    Form1.DrawString(
"A string",20090200,90, col)
End Sub
Reply With Quote
  #2 (permalink)  
Old 10-08-2008, 03:30 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by agraham View Post
However the text that is supposed to be drawn by both Form1.FDrawString and Form1.DrawString is not displayed at all!
Apologies - my stupidity. The dekstop and device differ in behaviour when DrawString is given a zero height box to draw in. The desktop ignores the zero height and draws the text, the device honours it and doesn't draw.

Quote:
The colours are also noticeably different although supposedly the same. It is not a scaling problem as the text sizes are the same.
If I increase the size of the text the problem diminishes. It turns out that this is related to font smoothing. Text drawn on the Forelayer is drawn using ClearType (and also Standard font smoothing on the desktop) if it is enabled, while text drawn on the background doesn't use ClearType - hence the visual difference for small characters. I have no idea why this difference should exist!
Reply With Quote
  #3 (permalink)  
Old 10-08-2008, 10:29 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,344
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Quote:
Originally Posted by agraham View Post
I have no idea why this difference should exist!
The clear type option, smooths text used on the device...
All apps, including b4ppc generated exes, use the forelayer to host all controls, like textboxes and labels, wich are texts controls...
Th backlayer is used only GRAPHICALLY so the clear type is not aplicable to it, thus rendering the text diferent...

OBS.
As I remember clear type can be disabled...Just to see the diference between cleartype ON and OFF...
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)

My Posts helped you? Consider Buying me a Porto Glass!
Reply With Quote
  #4 (permalink)  
Old 10-09-2008, 08:29 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by Cableguy View Post
The clear type option, smooths text used on the device...
I do know what ClearType is

Quote:
All apps, including b4ppc generated exes, use the forelayer to host all controls, like textboxes and labels, wich are texts controls...
The backlayer is used only GRAPHICALLY so the clear type is not aplicable to it, thus rendering the text diferent...
Entirely wrong I am afraid. The forelayer and backlayer on a B4ppc form are both bitmaps and have nothing to do with the controls at all which all draw themselves. Both these bitmaps are drawn in the same way using a .NET Graphics object associated with each bitmap. B4ppc uses these bitmaps during the form Paint event to update the form background image and so avoid the user having to program Paint events which they would have to in C# or VB.NET. During the Paint event the form uses a Graphics object (a Drawer) to draw the backlayer bitmap onto the forms Image and then if a forelayer exists also draws that on the forms Image. The forelayer is set to support transparency (the backlayer isn't) so only the non-transparent areas are actually drawn so overwriting the background in parts. If you want to see what is happening look in CEnhancedForm.cs in the Basic4ppc Desktop/Tzor folder.

Quote:
wich are texts controls...Th backlayer is used only GRAPHICALLY so the clear type is not aplicable to it, thus rendering the text diferent...
Remember that all Windows is GRAPHICS including text controls where the text is drawn using DrawString or a close cousin to render a Font object. DrawString does support ClearType via the Font it is rendering, witness its unwanted appearance on the forelayer. A Font (especially on the desktop) supports lots of other options too but typography is not one of my fortes so I don't understand all the options, and their effect in combination, the majority of which are not exposed in B4ppc. It is probably some combination of default Font settings that causes forelayer text to be rendered using font smoothing and backlayer text not.

Quote:
As I remember clear type can be disabled...Just to see the diference between cleartype ON and OFF...
That's how I established what was happening. I have established that is is probably some default settings to do with B4ppc using transparency on the forelayer bitmap but not on the backlayer.
Reply With Quote
  #5 (permalink)  
Old 10-09-2008, 11:39 AM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,344
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

I stand corrected, my apologies to the forum, for misleading informations...
Once again I have learned something...
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)

My Posts helped you? Consider Buying me a Porto Glass!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Forelayer not working(?) Cableguy Questions (Windows Mobile) 5 08-16-2008 11:52 AM
Form Forelayer on top of other controls ? klaus Questions (Windows Mobile) 2 08-01-2008 02:32 PM
Forelayer, please explain enonod Questions (Windows Mobile) 2 06-03-2008 03:37 PM
Colour Values Zenerdiode Questions (Windows Mobile) 2 05-20-2008 05:01 AM
Fastest way to get pixel colour value? DavidN Questions (Windows Mobile) 6 09-02-2007 06:40 AM


All times are GMT. The time now is 03:28 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0