IsPenWidthPixels() 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

The IsPenWidthPixels function determines if a pen width is in pixels or in points. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

IsPenWidthPixels( penwidth )

penwidth is a small integer representing the pen width.

Return Value

True if the width value is in pixels. False if the width value is in points.

Description

The IsPenWidthPixels() function will return TRUE if the given pen width is in pixels. The pen width for a line may be determined using the StyleAttr() function.

Example

Include "MAPBASIC.DEF"
Dim CurPen As Pen
Dim Width As Integer
Dim PointSize As Float
CurPen = CurrentPen()
Width = StyleAttr(CurPen, PEN_WIDTH)
If Not IsPenWidthPixels(Width) Then
	PointSize = PenWidthToPoints(Width)
End If

See Also:

CurrentPen() function, MakePen() function, Pen clause, PenWidthToPoints() function, StyleAttr() function