MakeCustomSymbol() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Returns a Symbol value based on a bitmap file. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

MakeCustomSymbol( filename, color, size, customstyle )

filename is a string up to 31 characters long, representing the name of a bitmap file. The file must be in the CustSymb directory inside the user's MapInfo directory.

color is an integer RGB color value; see RGB() function for details.

size is an integer point size, from 1 to 48.

customstyle is an integer code controlling color and background attributes. See table below.

Return Value

Symbol

Description

The MakeCustomSymbol() function returns a Symbol value based on a bitmap file. See Symbol clause for information about other symbol types.

The following table describes how the customstyle argument controls the symbol's style:

customstyle value Symbol Style
0 The Show Background, the Apply Color, and the Display at Actual Size settings are off; the symbol appears in its default state at the point size specified by the size parameter. White pixels in the bitmap are displayed as transparent, allowing whatever is behind the symbol to show through.
1 The Show Background setting is on; white pixels in the bitmap are opaque.
2 The Apply Color setting is on; non-white pixels in the bitmap are replaced with the symbol's color setting.
3 Both Show Background and Apply Color are on.
4 The Display at Actual Size setting is on; the bitmap image is rendered at its native width and height in pixels.
5 The Show Background and Display at Actual Size settings are on.
7 The Show Background, the Apply Color, and the Display at Actual Size settings are on.

Example

Include "mapbasic.def" 
Dim sym_marker As Symbol
sym_marker = MakeCustomSymbol("CAR1-64MP", BLUE, 18, 0)

See Also:

CurrentSymbol() function, MakeFontSymbol() function, MakeSymbol() function, StyleAttr() function, Symbol clause