ColorGraphics
Previous Topic  Next Topic 

Product

ColorGraphics

Manufacturer

Standard Satellite Forms component

Website

http://www.satelliteforms.net/

Source code provided

Yes

Platform

PalmOS and PocketPC

Sample project(s)

Color Table, Color Graphics

Keywords

color, graphics, draw, line, font


Graphics is an SFX extension that can be used to manipulate and draw graphics and text within your applications.


Parameters


Black and white colors are defined as follows (on a color Palm these are simply patterns):

Black                0

Gray                 1

White               2

Transparent       3  

Invert               4


Font styles are defined as follows:

stdFont                        0

boldFont                       1

largeFont                      2

symbolFont                   3

symbol11Font                4

symbol7Font                  5

ledFont                         6


Scripts API


The following methods are accessible from the scripting language.  Note that these are all public methods except for About().  


Usage:       Public Method:  [Name of method]


                Private Method:  [Name of extension].[Name of method]


Example of usage:  Public Method:  EditExSetInsertion(MainParagraphIndex, 0)


                          Private Method:  Extensions(“Graphics”).About()


About()

Private method that shows the extension's about box.



DrawBar(integer, integer, integer, integer)

Draw (bar graph w/fill) bar: Bottom Length  = X,Y; Width  = W, and Height = H.

Example of usage:  DrawBar(X, Y, W, H)



DrawCircle(integer, integer, integer)

Draws Circle using curr. Pen & Fill.  Center = X0, Y0 and  Radius = R 

Example of usage:  DrawCircle(X0, Y0, R)


DrawRect(integer, integer, integer, integer)

Draws Rectangle using curr. Pen & Fill. 

Example of usage:  DrawRect(X0, Y0, X1, Y1)


DrawLine(integer, integer, integer, integer)

Draws a line using current pen color.

Example of usage:  DrawLine(X0, Y0, X1, Y1)


DrawRoundedRect(integer, integer, integer, integer, integer)

Draws rounded rectangle with a corner radius determined by the R parameter. 

Example of usage:  DrawRoundedRect(X0, Y0, X1, Y1, R)


DrawText(string, integer, integer)

Draws the specified text at starting at the specified point. 

Example of usage:  DrawText(“I’m here”, 50, 60)


EraseBar(integer, integer, integer, integer)

Erases Above (same parameters).

EraseCircle(integer, integer, integer)

Erases circle (always erases inside).  Center = X0, Y0; Radius = R. 

Example of usage:  See DrawCircle.


EraseLine(integer, integer, integer, integer)

Erases line  

Example of usage:  EraseLine(X0, Y0, X1, Y1)


EraseRect(integer, integer, integer, integer)

Erases Rectangle (if FillColor = Transparent, skips inside erasure). 

Example of usage:  See DrawRect.


EraseText(string, integer, integer)

Erases text as drawn in DrawText (same params).


GetFillColor()

Gets the fill (inside) color. 

Example of usage:  n = GetFillColor()


GetPenColor()

Gets the pen (border) color. 

Example of usage:  n = GetPenColor()



InvertText(string, integer, integer)

Write text with opposite colors of the current text colors.

Example of usage:  InvertText(“I’m here”, 50, 60)


Is35()

Checks to see if the current handheld contains Palm OS® version 3.5 and up ROM’s.  Returns a TRUE or FALSE value.

Example of usage:  Test = Is35()



SetBackColor(integer)

Set the background color to the corresponding  color in the current 256 color table.

Example of usage:  SetBackColor(40)


SetFillColor(integer)

Set the pen (inside) color. 

Example of usage:  SetFillColor(Color)


SetFont(integer)

Sets font style for DrawText 

Parameters:

0          stdFont

1          boldFont

2          largeFont

3          symbolFont

4          symbol1Font

5          symbol7Font

6          ledFont



SetForeColor(integer)

Sets the foreground color to the corresponding color in the current 256 color table.

Example of usage:  SetForeColor(25)


SetPattern(integer, integer, integer, integer)

Sets 8x8 Custom Fill Pattern: Integers P0, P1, P2, and P3 create a bitmap.


SetPenColor(integer)

Sets the Pen (border) Color. 

Example of usage:  SetPenColor(Color)


SetTextColor(integer)

Sets the text displayed by this extension to the corresponding color in the current 256 color table.

Example of usage:  SetTextColor(90)



DocID: 10009  DocDate: 2005-07-18