PixelTypeToStr (replaces PixelTypeToStr)


The PixelTypeToStr function returns the pixel type name corresponding to the numeric pixel type code. For example passing 5 returns "float".

Syntax

sValue = PixelTypeToStr( number )

bullet.gif    numberis the pixel type code from the Pixel Types table.

bullet.gif    string is the pixel type name from the Pixel Types table.

Example

The script below shows how to create a text output window with a specified placement inside the main Mira window. We want the text window to stretch horizontally from 10% to 70% of the main window width and vertically from 20% to 60% of the main window height. Below is a function that does this:

 

t = 5

-- pixel type number 5

s = PixelTypeToStr( t )

-- get the corresponding name string

Printf("type=%d, name=%s", t, s )

-- result: type=5, name="float"

Related Topics

StrToPixelType, CImage:SetPixelType, Pixel Types


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.