          Bmp Wizard

Use:

Introduction

Script language

Examples

Versions

Menu commands:

File menu

Edit menu

View menu

Help menu

Author:

Andrea Benoni	E_Mail	MC5211@MCLINK.IT

Lungadige Trento, 50	Compuserve	100042,1264

37012 Bussolengo Verona

Italy


Run/Stop

Pressing this buttons execute current script language or stop the running one.

Shortcuts

Toolbar:

Keys:	CTRL+R


Introduction
Introduction:

As a graphic programs user I often need to modify/filter bitmap accessing pixel data at low level.

BmpWiz accomplish this need, using a Basic like language to modify BMP.

To obtain better performance script instructions are semicompiled.

There are some base filter ready to run, but it is easy to creating or derive new one.

This is a shareware software, you must register to use it , with registration you obtain new releases notification and bug-fixing, the registration cost is 40$.

This is the 32 bit version of BmpWiz that could be used in Windows NT or Windows ´95 and Windows 3.1x or Windows for Workgroup with Win32s extensions.


Script language:

BmpWiz script (BWL) is a basic like language.

There are two main difference from basic, BWL accept only one instruction each row (except expression) and variables must be declared.

Remark:

Allows explanatory remarks to be inserted in a program preceding them with a single quotation mark ['].

Variables & constants:

Variables must be defined before their use with the syntax:

var_type var_name[,var_name]

es:

float 	x,y

Characters allowed in a variable name are only letters.

There are two family of variables type:

Simple:

float	floating point number

string	character string

Structured:

DevCon	image

Width	image width (read only)

Height	image height (read only)

BitCount	bit number per pixel (read only)

Res	resolution

ClrImp	colors importants (for image rendering)

RGB	color info in RedGreenBlue format

Lum	luminosity (0-255) or (Red+Green+Blue)/3

Red	red component (0-255)

Green	green component (0-255)

Blue	blue component (0-255)

HBS	color info in HueBrightSaturation format

Hue	color (0-240)

Bri	bright (0-240)

Sat	saturation (0-240)

Structured variables could receive data using assignment.

To access single components you must specify component name after variable name separated by a dot.

es:

define a color variable

RGB	pix

set pix red component to max:

pix.Red=255

HBS struct cannot be used with graphical instructions, the color information must be assigned to a RGB variable before its use.

You can define arrays of float using [n] int the definition line, n is the elements number.

To use arrays in the program you must specify the index (0 based), es:

float ar[10]

ar[0]=1

ar[1]=ar[0]+1

Costants could be numbers or string, numbers must be in the n.n form, strings must be enclosed in double quotation marks.

Statement & functions:

Graphics commands:

DevCon=LoadImage(string Name):

Reads a bitmap from disk returning a DevCon value.

Name could be a variable or a constant that point to a file in the Windows BMP format, 1/4/8/24 bits.

Memory bitmap pointed by DevCon have the same width lenght and color limits of the BMP file.

To get a bitmap from clipboard you must specify its name as file to read (es: Ibmp=LoadImage("CLIPBOARD") ), then program flow stop waiting a bitmap in the clipboard.

Reading/writing to clipboard allow to build macro like script that operate inside other graphic programs, ClpBrd.Bas demotrate this use.

DevCon=CreateImage(float Xdim,float Ydim,float bit)

Creates a bitmap in memory with the specified limits.

Return a DevCon value that must be used as reference.

In the 1/4/8 bit format a gray palette will be associated to the image.

SaveImage(DevCon img,string Name)

Saves the img memory bitmap in a file.

If file name is "CLIPBOARD" destination will be the clipboard.

RGB=GetPalette(DevCon img,float enum)

Obtains the RGB value of the enum element from palette associated to the img bitmap.

SetPalette(DevCon img,float enum,RGB pix)

Sets the RGB value of the enum element in the palette associated to the img bitmap.

Pixel access:

RGB=GetPixel(DevCon img,float x,float y)

Reads the RGB value of the x,y pixel inside img bitmap.

val=GetPixelVal(DevCon img,float x,float y)

Reads the numeric value of the x,y pixel inside img bitmap, usefull to get pixel numeric values (palette index) of 4/8 bit images.

SetPixel(DevCon img,float x,float y, RGB pix)

Sets the RGB value of the x,y pixel inside img bitmap.

SetPixelVal(DevCon img,float x,float y, float val)

Sets the numeric value of the x,y pixel inside img bitmap, faster than SetPixel bypassing palette.

Flow:

If (cond)

...

[else

...]

endif

If cond is TRUE (TRUE <> 0) execute following commands until else, if cond is FALSE program flow skip to the command following else.

Cond could be any sequence of operator evaluated from left to right, operator inside bracket are evaluated first.

For var=(exp1) To (exp2) [Step (exp3)]

Next var

Executes a loop from exp1 to exp2 counting in var, increment is exp3 or 1 if not specified.

Return

Terminates the program execution.

Display & I/O:

string=GetFileName(string Title)

Asks a file name using the Windows common dialog, return a string value.

string=FileFind(string Mask)

Return a file name, command could be iterate to return all files names.

DspMes(...)

Displays a sequence of variable and constants in any order.

Debug()

Suspend program execution and shows variables contents in a window.

[if]/[val=] DspWhile(string text,float perc)

Displays a dialog with a message and a cursor with a percentage value.

Value returned is TRUE if stop button has been pressed.

Preview(DevCon img,string title,float x, float y [, float xdim,float ydim])

Displays the img bitmap in a window with the specified characteristics.

Operators:

Operators are evaluated in expression from the left to the right, operator inside bracket are evaluated first.

Arithmetic operators:

+	 	sum

- 	subtract

* 	multiply

/ 	divide

% 	module

Sin(exp) 	sin

Cos(exp) 	cosin

Rand(exp)	random number in 0-exp range

Min(a,b)	minimum between a e b

Max(a,b)	maximum between a e b

Int(a)	integral part of a

Logical:

>	greater

<	less

=	equal

>=	greater or equal

<=	less or equal

<>	not equal

&	and

|	or

^	xor

!	not


File menu commands
File menu

New	Create a new script.
Open	Load a script from disk.
Save	Save current script.
Save As	Save current script with a different name.
Print	Print current script.
Print Preview	Print preview.
Print Setup	Select printer.
Exit	Exit.


Edit menu

Undo	Undo last editing.
Cut	Cut current selection.
Copy	Copy current selection.
Paste	Paste data in clipboard.


View menu

Toolbar	Display the Toolbar.
Status Bar	Hide the Status Bar.


Help menu

Index	Help index.
Using Help	Help on help.
About	About program.


File New command
New (File menu)

Clear editing window and display a base script.

Shortcuts

Toolbar:

Keys:	CTRL+N


File Open command
Open (File menu)

Load a script (*.bas) file from disk.

Shortcuts

Toolbar:

Keys:	CTRL+O


File Open dialog box

Permit to specify input file.


File Save command
Save (File menu)

Save current script.

Shortcuts

Toolbar:

Keys:	CTRL+S


File Save As command
Save As (File menu)

Save current script with a different name, display the Save As Dialog.


File Save As dialog box

Permit to specify output file.


File Exit command
Exit (File menu)

Exit from the program.

Shortcuts

Mouse:	Double-click the application's Control menu button.

Keys:	ALT+F4


Undo/Can't Undo command (Edit menu)

Undo last editing.

Shortcuts

Keys:	CTRL+Z or

ALT-BACKSPACE


Redo (Edit menu)

Replay editing.


Cut (Edit menu)

Shortcuts

Toolbar:

Keys:	CTRL+X


Copy (Edit menu)

Shortcuts

Toolbar:

Keys:	CTRL+C


Paste (Edit menu)

Shortcuts

Toolbar:

Keys:	CTRL+V


View Toolbar command
Toolbar

 New create a new script.

 Open load a script from disk.

 Save memorize a script on disk.

 Print the active document.

 Run/Stop current script.

 Cut.

 Copy.

 Paste.


View Status Bar Command
Status Bar

Codice	Significato

CAP	Caps lock.

NUM	Num lock.

SCRL	Scroll lock.


Index (Help menu)

Help index.


Using Help (Help menu)

Help on help.


About (Help menu)

Program information.


Help Using Help Command
Context Help command

Shortcut

Keys:	SHIFT+F1


Examples
Examples:

BRI_SAT 	Demostrate how to modify pixel brightness an saturation

LOGO	Substitute Win95 startup logo

MOSAIC	Mosaic effect with black line separator

MOSAIC1 	Mosaic effect with black line separator with variable size tessera.

LAKE 	Simulate water reflection

CATODE 	Scompose RGB components in separate pixel like CRT

FLAG 	Flag distortion

LUMINOSI 	Modify brightness

ANTILIAS 	Antialias on B/W  images

RAND	Modify randomly pixel brightness

RAND1    	Random BW image

TAP 	Distortion

SPHERE	Distortion

SPHERE1 	Distortion

SPHERE2	Colored spheres

SPHERE3	Distortion

SEPARATE 	Separate RGB colors components.

BRICK	Pattern blend

PEAKS	Pattern blend

EROSION 	Eliminate noise from BW images

CAOS 	Random mix pixel

CAOS1	Random mix pixel

SEPPIA 	Modify to purple tone

FADE	Brightness fade

FADE1    	Color fade

BNSCALE	Gray scale

GRANITE	Granite pattern blend

PATTERN	Repeats image as a pattern

CLPBRD	Demostrate Clipboard interaction

CUBE	Construct a cube

TO16GRY	Reduct with antialiasing

EXT	Chroma key with background change

EXT1	Modify color image

TRIANGOL	Pattern blend

SIZE2-	Resize image

SIZE4-	Resize image

SIZE2X 	Double size

SIZE2XT	Double with interpolation

ITALICO 	Image distortion

SHADE 	Shade on BW image

CNV16GRY 	Convert to 4 bit gray scale

SWITCH	Switch color components

CNV24BIT	Convert to 24 bit images

NEG 	Invert brightness

SPECULA	Mirror

SCAL8RGB 	RGB scale

RIS_DEF  	Demostration of resolution vs. definition

SCALA8CO 	Color scale

SCALABN  	Gray scale

SCALACO  	24 bit color scale

SCALAHBS 	24 bit color scale

SCALARGB 	24 bit color scale

SCOMPONE 	Color separtion

STATS	Calculate single palette element use

STATSBN  	Count black pixel

FERN 	Calculate a fern (fractal)


Versions
Versions:

1.3

32 bit version

Clipboard support

1.50

New  filters

1.51

Minor bug fix

Error editing scripts of different len.

1.6

New feature

Arrays

Negative numeric constant

New instructions

Debug

GetPixelVal

SetPixelVal

New filter

Pattern

Fern

Stats

StatsBN


No Help Available


File Print command
Print command (File menu)

Use this command to print a document.   This command presents a Print dialog box, where you may specify the range of pages to be printed, the number of copies, the destination printer, and other printer setup options.

Shortcuts

Toolbar:

Keys:	CTRL+P


Print dialog box

The following options allow you to specify how the document should be printed:

Printer

This is the active printer and printer connection.  Choose the Setup option to change the printer and printer connection.

Setup

Displays a Print Setup dialog box, so  you can select a printer and printer connection.

Print Range

Specify the pages you want to print:

All	Prints the entire document.
Selection	Prints the currently selected text.
Pages	Prints the range of pages you specify in the From and To boxes.
Copies

Specify the number of copies you want to print for the above page range.

Collate Copies

Prints copies in page number order, instead of separated multiple copies of each page.

Print Quality

Select the quality of the printing.  Generally, lower quality printing takes less time to produce.


Print Progress Dialog

The Printing dialog box is shown during the time that <<YourApp>> is sending output to the printer.  The page number indicates the progress of the printing.

To abort printing, choose Cancel.


File Print Preview command
Print Preview command (File menu)

Use this command to display the active document as it would appear when printed.  When you choose this command, the main window will be replaced with a print preview window in which one or two pages will be displayed in their printed format.  The print preview toolbar offers you options to view either one or two pages at a time; move back and forth through the document; zoom in and out of pages; and initiate a print job.


Print Preview toolbar

The print preview toolbar offers you the following options:

Print

Bring up the print dialog box, to start a print job.

Next Page

Preview the next printed page.

Prev Page

Preview the previous printed page.

One Page / Two Page

Preview one or two printed pages at a time.

Zoom In

Take a closer look at the printed page.

Zoom Out

Take a larger look at the printed page.

Close

Return from print preview to the editing window.


File Print Setup command
Print Setup command (File menu)

Use this command to select a printer and a printer connection.  This command presents a Print Setup dialog box, where you specify the printer and its connection.


Print Setup dialog box

The following options allow you to select the destination printer and its connection.

Printer

Select the printer you want to use.  Choose the Default Printer; or choose the Specific Printer option and select one of the current installed printers shown in the box.  You install printers and configure ports using the Windows Control Panel.

Orientation

Choose Portrait or Landscape.

Paper Size

Select the size of paper that the document is to be printed on.

Paper Source

Some printers offer multiple trays for different paper sources.  Specify the tray here.

Options

Displays a dialog box where you can make additional choices about printing, specific to the type of printer you have selected.

Network...

Choose this button to connect to a network location, assigning it a new drive letter.


File Page Setup Command
Page Setup command (File menu)

<< Write application-specific help here. >>