BlendBitmapFont
BlendBitmapFont FontIndex, RGB
 
Parameters:

    FontIndex = The index identifier of the font you wish to convert
    RGB = The Colour of the bitmap font in RGB format
Returns: NONE
 

      BlendBitmapFont will blend a bitmap image with a bitmap font. The command scans each letter in your fonts character set comparing them with the bitmap image. Each individual pixel that is not black in the fonts characters, will be replaced with the equivalent pixel from the blend image you provided. This allows you to pre-apply shadings and even rub certain pixels out.



FACTS:


      * The BlendBitmapFont process always treats black (rgb(0,0,0)) as transparent.

      * Note: BlendBitmapFont only works with Video Bitmap fonts.



Mini Tutorial:


      This simple example loads the windows Arial font. Once loaded it then converts this font to bitmap version and blends it with a previously created shaded image. The result after blending, is that the bitmap font is now shaded.


  
  
; Make a variable called Size, that we'll use
; as the size of our font
  Size=45
  
  
; First we'll Create a shaded image to blend with our font.
  CreateImage 1,Size,Size
  
; Direct all rendering to image 1
  RenderToImage 1
  
; Create a shaded image
  For lp=0 To Size
     BoxC 0,lp,size,lp+1,1,RGBFade(RGB(100,100,255),(100.0/size)*lp)
  Next
  
; Direct all rendering to the screen again
  RenderToScreen
  
; Load the "Arial" font as font 2, of size 24, in the normal style
  LoadFont "Arial",2,size,0
  
; Convert font 2 to a Bitmap font in a whiteblue colour
  MakeBitmapFont 2,RGB(255,255,255)
  
; Blend our previous created bitmap image with the characters
; in font 2
  BlendBitmapFont 2,1
  
; Set Font 2 at the current font.
  SetFont 2
  
; Display a message in the New current font
  Text 0,100,"This text is displayed in the Blended Arial font"
  
; Display the screen and wait for a key top be pressed
  Sync
  WaitKey
  
  
  



This example would output.

  
  This Text is displayed in the Blended Arial font
  

 
Related Info: CreateBitmapFont | MakeBitmapFont | MakeShadowBitmapFont :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com