Board index » cppbuilder » Bitmap buttons: different effects on different system font?

Bitmap buttons: different effects on different system font?

Hello,

I'm using Bitmap buttons on my form. I've created bitmaps to cover the
button. Bitmap Buttons  work fine if I use the application in small
windows font (that's what I use by default). Now if I change the windows
font to "Large", this results in enlarging the application. Buttons get
enlarged too, but bitmaps don't get enlarged to the same proportion.
Result: the sides of buttons get displayed as gray while the center of
the button is covered with the bitmap. This looks UGLY!
Any idea how to solve the problem: Do I need to use different bitmaps
for different fonts? If yes, then how do I find out about font?
Or can I make the bitmap buttons to remain the same size irrespective of
system font?
Or is there any other better solution.
Any help would be greatly appreciated.

Thanks,
Deepika.

 

Re:Bitmap buttons: different effects on different system font?


If your using CopyRect to work on the bitmaps, try using StretchDraw in
stead.

Lars

Quote
Deepika Goyal wrote in message <36B26963.AC9D4...@mw.3com.com>...
>Hello,

>I'm using Bitmap buttons on my form. I've created bitmaps to cover the
>button. Bitmap Buttons  work fine if I use the application in small
>windows font (that's what I use by default). Now if I change the windows
>font to "Large", this results in enlarging the application. Buttons get
>enlarged too, but bitmaps don't get enlarged to the same proportion.
>Result: the sides of buttons get displayed as gray while the center of
>the button is covered with the bitmap. This looks UGLY!
>Any idea how to solve the problem: Do I need to use different bitmaps
>for different fonts? If yes, then how do I find out about font?
>Or can I make the bitmap buttons to remain the same size irrespective of
>system font?
>Or is there any other better solution.
>Any help would be greatly appreciated.

>Thanks,
>Deepika.

Re:Bitmap buttons: different effects on different system font?


Quote
> button. Bitmap Buttons  work fine if I use the application in small
> windows font (that's what I use by default). Now if I change the windows
> font to "Large", this results in enlarging the application. Buttons get
> enlarged too, but bitmaps don't get enlarged to the same proportion.

Here's Harold Howe's definitive posting on the subject:

In general, try to stay in one of these camps

Camp A, the better camp:

Design your program with small fonts
Set Scaled to true for the form
Set AutoScroll to false
Set BorderStyle to bsDialog or bsSingle

I'm not sure if the font thing that ZDTips talked about is necessary, but it
won't hurt. Using custom fonts will only get you into trouble anyway when
you run the program on a machine that doesn't have that font.

With this strategy, the BorderStyle is critical. When Scaled is true,
controls expand by a ratio of 120/96 when run on a large font machine. When
BorderStyle is bsDialog or bsSingle, the size of the form also grows.
However, if you use bsSizable, the form does not grow. When this happens,
the resized controls fall of the edge of the form. This is why the form
displays the ugly scroll bars. If you must use bsSizable, adjust the Height
and Width of the form if you detect Large fonts, see my FAQ at

http://www.bcbdev.com/faqs/faq25.htm

Note, if you run into trouble with labels, follow these suggestions. If
single line labels get chopped off, try setting AutoSize to false for the
label. Then widen the label by a factor of 120/96 or more. This gives the
text room to grow. For multi line lables, set autosize to false, keep
WordWrap to true, and expand the Height of the label so it has a spare line
or two. This allows the text to grow and fill up the rest of the label. At
small fonts, these labels will seem farther apart than they do to a user
running a large fonts.

Also note, designing at small fonts means that you have to deal with
problems of forms that expand when run on a large font machine. The problems
that are caused by expanding forms are probably easier to deal with than
forms that shrink, which is what happens when you design at large fonts and
run at small fonts.

Camp B

Design using small fonts
Always set Scaled to false
Set AutoScale to false

This essentially turns off all scaling and leaves it up to you. It also
tends to cause as many problems as it solves.

Camp C

Tell users of Large fonts to take a hike. This isn't always practical, but
where I work, it is :) Because Visual C++ and MFC are no better at dealing
with fonts (in fact they're worse), our IT department has specified that our
programs (both MFC and BCB programs) will function correctly at 800x600, 16
bit high color, small fonts. If your not running that, don't complain (I
didn't make these rules by the way, but I don't seek its abolishment
either). If your software ends up on a shelf at compusa, this strategy might
not be wise.

Harold Howe (TeamB)
http://www.bcbdev.com

+===================================================+
| Jonathan Arnold (mailto:jdarn...@buddydog.org)    |
| Engineering Manager       Roger Wagner Publishing |
| http://people.ne.mediaone.net/jdarnold            |
+===================================================+

 Diplomacy is the art of saying "Nice doggie" until
 you can find a rock.   -- Will Rogers

Re:Bitmap buttons: different effects on different system font?


Erhmmm......
I dont think its this tough :)

Setting the font properties correctly (cant remember the excact settings)
will as far as text, labels etc etc goes, work fine on any font settings.
The problem with the graphics is, that using ex default CopyRect (a common
choice ;o) will not resize correctly.
StretchDraw will.
I once looked the API settings over, to figure out the difference, but cant
remember the details...

Hmmmm..... seems like I forgot most of the facts... hehe... but it sure
works...

Lars

Quote
Jonathan Arnold wrote in message <36B5A0F9.2E5CC...@buddydog.org>...
>> button. Bitmap Buttons  work fine if I use the application in small
>> windows font (that's what I use by default). Now if I change the windows
>> font to "Large", this results in enlarging the application. Buttons get
>> enlarged too, but bitmaps don't get enlarged to the same proportion.

>Here's Harold Howe's definitive posting on the subject:

>In general, try to stay in one of these camps

>Camp A, the better camp:

>Design your program with small fonts
>Set Scaled to true for the form
>Set AutoScroll to false
>Set BorderStyle to bsDialog or bsSingle

>I'm not sure if the font thing that ZDTips talked about is necessary, but
it
>won't hurt. Using custom fonts will only get you into trouble anyway when
>you run the program on a machine that doesn't have that font.

>With this strategy, the BorderStyle is critical. When Scaled is true,
>controls expand by a ratio of 120/96 when run on a large font machine. When
>BorderStyle is bsDialog or bsSingle, the size of the form also grows.
>However, if you use bsSizable, the form does not grow. When this happens,
>the resized controls fall of the edge of the form. This is why the form
>displays the ugly scroll bars. If you must use bsSizable, adjust the Height
>and Width of the form if you detect Large fonts, see my FAQ at

>http://www.bcbdev.com/faqs/faq25.htm

>Note, if you run into trouble with labels, follow these suggestions. If
>single line labels get chopped off, try setting AutoSize to false for the
>label. Then widen the label by a factor of 120/96 or more. This gives the
>text room to grow. For multi line lables, set autosize to false, keep
>WordWrap to true, and expand the Height of the label so it has a spare line
>or two. This allows the text to grow and fill up the rest of the label. At
>small fonts, these labels will seem farther apart than they do to a user
>running a large fonts.

>Also note, designing at small fonts means that you have to deal with
>problems of forms that expand when run on a large font machine. The
problems
>that are caused by expanding forms are probably easier to deal with than
>forms that shrink, which is what happens when you design at large fonts and
>run at small fonts.

>Camp B

>Design using small fonts
>Always set Scaled to false
>Set AutoScale to false

>This essentially turns off all scaling and leaves it up to you. It also
>tends to cause as many problems as it solves.

>Camp C

>Tell users of Large fonts to take a hike. This isn't always practical, but
>where I work, it is :) Because Visual C++ and MFC are no better at dealing
>with fonts (in fact they're worse), our IT department has specified that
our
>programs (both MFC and BCB programs) will function correctly at 800x600, 16
>bit high color, small fonts. If your not running that, don't complain (I
>didn't make these rules by the way, but I don't seek its abolishment
>either). If your software ends up on a shelf at compusa, this strategy
might
>not be wise.

>Harold Howe (TeamB)
>http://www.bcbdev.com

>+===================================================+
>| Jonathan Arnold (mailto:jdarn...@buddydog.org)    |
>| Engineering Manager       Roger Wagner Publishing |
>| http://people.ne.mediaone.net/jdarnold            |
>+===================================================+

> Diplomacy is the art of saying "Nice doggie" until
> you can find a rock.   -- Will Rogers

Other Threads