Promixis
April 20th, 2005, 01:21 PM
New OSD object... docs below...
The On Screen Display (OSD)
The OSD table holds the following functions.
osd, error = osd.CreateOSD()
image,error = osd.CreateImage(filename)
pen = osd.CreatePen(width, Brush)
brush = osd.CreateSolidBrush( Color )
brush = osd.CreateLinearGradientBrush( number x1,y1,x2,y2, Color1, Color2 )
brush = osd.CreateTexturedBrush( Image, [WrapMode, x1,y1,x2,y2 ] )
brush = osd.CreateHatchBrush( Hatch, color1, color2 )
color = osd.MakeARGB(alpha, red,green, blue)
The MarkARGB function generates a number that represents the color and alpha intensities that you specified.
the OSD Object
The OSD object has the folling members
Destroy()
Show()
Hide()
SetTranparancy( colorkey, transparancy )
Position( x,y)
Size( w,h)
Topmost( bool )
Line ( x1,y1, x2, y2, Pen)
w,h = MeasureString( Text, FontName, FontSize)
w,h = MeasureStringFull( Text, FontName, FontSize, BoxWidth, BoxHeight, HorizonalAlignment, VerticalAlignment)
DrawString( Text, FontName, FontSize, Brush)
DrawStringFull( Text, FontName, FontSize, BoxWidth, BoxHeight, HorizonalAlignment, VerticalAlignment, Brush)
DrawImage(Image, x,y)
ScaleDrawImage( Image, x, y, Width, Height )
FillRectangle( x,y,width, height, Brush)
DrawRectangle( x,y,width, height, Pen)
FillEllipse( x,y,width, height, Brush)
DrawEllipse( x,y,width, height, Pen)
FillPie( x,y,width, height, StartAngle, SweepAngle, Brush)
DrawPie( x,y,width, height, StartAngle, SweepAngle, Pen)
OnClick( OnClick function )
OnPaint( OnPaint function )
WorkOnBuffer(bool)
CopyBufferToScreen()
SetSmoothingMode(mode)
SetInterpolationMode(mode)
Clear(color)
Destroy destroys the window
Show, shows the window
Hide, hides the window
Size, resizes the window, note: The window is not automatically redrawn!
Topmost, sets the topmost flag on the window, if true, this window will float over any other windows.
Line, draws a line
MeasureString, returns the size of the bounding box of that particular string.
MeasureStringFull, returns the size of the bounding box of that particular string.
DrawString, draws the string on the OSD
DrawStringFull, draws the string on the OSD
DrawImage, draws the Image on the OSD
ScaleDrawImage, scales and draws the image on the OSD
FillRectangle, draws a filled rectangle
DrawRectangle, draws a rectangle
FillEllipse, draws an filled ellipse
DrawEllipse, draws an ellipse
FillPie, draws a filled pie
DrawPie, draws a pie
OnClick, specifies which function should be called when the user clicks on the OSD ( function MyOnClick ( number x, number y), this allows for interactive OSDs! )
OnPaint, Drawing on the OSD is not persistent, thus it can be cleared at any momeny, the OnPaint function will be called to restore the OSD. Note that a good way around this is by drawing on the Buffer instead of the OSD, then in the OnPaint simply call CopyBufferToScreen() since the buffer is persistent. Also using the buffer is a good way to prevent screen flicker. (Double buffering).
WorkOnBuffer( boolean ), set this to true to do all the drawing in the off-screen buffer, when you are done drawing copy all of this to the main screen.
CopyBufferToScreen(), this copies the offscreen buffer to the visible OSD.
SetSmoothingMode, Sets the smoothing mode of the drawing operations.
SetInterpolationMode, set the interpolation mode of the Image scaling routines.
Clear, clears the screen in the color specified.
Image Object
The image object.
number w, number h = Image:Size()
boolean ani = Image:Animated()
Image:Animate()
Image:Pause( boolean pause )
Image:Destroy()
Call Animate if you want the image to be animated.
Pen Object
The pen, Usually used for the Drawing functions.
Pen:Destroy();
Pen:SetDashStyle(DashStyle)
Pen:SetDashCap(DashCap)
Pen:SetStartCap(LineCap)
Pen:SetEndCap(LineCap)
Brush Object
The Brush, Usually used for the Fill functions.
Brush:Destroy();
Alignment Constants
StringAlignmentNear -- Left
StringAlignmentCenter -- Center
StringAlignmentFar -- Right
Smoothing Constants
SmoothingModeDefault -- The default smoothing
SmoothingModeHighSpeed -- Fast
SmoothingModeHighQuality -- High Quality
SmoothingModeNone -- None
SmoothingModeAntiAlias - Anti Aliased
Interpolation Constants
InterpolationModeDefault -- Specifies the default interpolation mode.
InterpolationModeLowQuality -- Specifies a low-quality mode.
InterpolationModeHighQuality -- Specifies a high-quality mode.
InterpolationModeBilinear -- Specifies bilinear interpolation. No prefiltering is done. This mode is not suitable for shrinking an image below 50 percent of its original size.
InterpolationModeBicubic -- Specifies bicubic interpolation. No prefiltering is done. This mode is not suitable for shrinking an image below 25 percent of its original size.
InterpolationModeNearestNeighbor -- Specifies nearest-neighbor interpolation.
InterpolationModeHighQualityBilinear -- Specifies high-quality, bilinear interpolation. Prefiltering is performed to ensure high-quality shrinking.
InterpolationModeHighQualityBicubic -- Specifies high-quality, bicubic interpolation. Prefiltering is performed to ensure high-quality shrinking. This mode produces the highest quality transformed images.
WrapMode Constants
WrapModeTile -- Specifies tiling without flipping.
WrapModeTileFlipX -- Species that tiles are flipped horizontally as you move from one tile to the next in a row.
WrapModeTileFlipY -- Specifies that tiles are flipped vertically as you move from one tile to the next in a column.
WrapModeTileFlipXY -- Specifies that tiles are flipped horizontally as you move along a row and flipped vertically as you move along a column.
WrapModeClamp -- Specifies that no tiling takes place.
HatchStyle Constants
HatchStyleHorizontal
HatchStyleVertical
HatchStyleForwardDiagonal
HatchStyleBackwardDiagonal
HatchStyleCross
HatchStyleDiagonalCross
HatchStyle05Percent
HatchStyle10Percent
HatchStyle20Percent
HatchStyle25Percent
HatchStyle30Percent
HatchStyle40Percent
HatchStyle50Percent
HatchStyle60Percent
HatchStyle70Percent
HatchStyle75Percent
HatchStyle80Percent
HatchStyle90Percent
HatchStyleLightDownwardDiagonal
HatchStyleLightUpwardDiagonal
HatchStyleDarkDownwardDiagonal
HatchStyleDarkUpwardDiagonal
HatchStyleWideDownwardDiagonal
HatchStyleWideUpwardDiagonal
HatchStyleLightVertical
HatchStyleLightHorizontal
HatchStyleNarrowVertical
HatchStyleNarrowHorizontal
HatchStyleDarkVertical
HatchStyleDarkHorizontal
HatchStyleDashedDownwardDiagonal
HatchStyleDashedUpwardDiagonal
HatchStyleDashedHorizontal
HatchStyleDashedVertical
HatchStyleSmallConfetti
HatchStyleLargeConfetti
HatchStyleZigZag
HatchStyleWave
HatchStyleDiagonalBrick
HatchStyleHorizontalBrick
HatchStyleWeave
HatchStylePlaid
HatchStyleDivot
HatchStyleDottedGrid
HatchStyleDottedDiamond
HatchStyleShingle
HatchStyleTrellis
HatchStyleSphere
HatchStyleSmallGrid
HatchStyleSmallCheckerBoard
HatchStyleLargeCheckerBoard
HatchStyleOutlinedDiamond
HatchStyleSolidDiamond
HatchStyleTotal
LineCap Constants
LineCapFlat
LineCapSquare
LineCapRound
LineCapTriangle
LineCapNoAnchor
LineCapSquareAnchor
LineCapRoundAnchor
LineCapDiamondAnchor
LineCapArrowAnchor
DashStyle Constants
DashStyleSolid
DashStyleDash
DashStyleDot
DashStyleDashDot
DashStyleDashDotDot
DashCap Constants
DashCapFlat
DashCapRound
DashCapTriangle
The On Screen Display (OSD)
The OSD table holds the following functions.
osd, error = osd.CreateOSD()
image,error = osd.CreateImage(filename)
pen = osd.CreatePen(width, Brush)
brush = osd.CreateSolidBrush( Color )
brush = osd.CreateLinearGradientBrush( number x1,y1,x2,y2, Color1, Color2 )
brush = osd.CreateTexturedBrush( Image, [WrapMode, x1,y1,x2,y2 ] )
brush = osd.CreateHatchBrush( Hatch, color1, color2 )
color = osd.MakeARGB(alpha, red,green, blue)
The MarkARGB function generates a number that represents the color and alpha intensities that you specified.
the OSD Object
The OSD object has the folling members
Destroy()
Show()
Hide()
SetTranparancy( colorkey, transparancy )
Position( x,y)
Size( w,h)
Topmost( bool )
Line ( x1,y1, x2, y2, Pen)
w,h = MeasureString( Text, FontName, FontSize)
w,h = MeasureStringFull( Text, FontName, FontSize, BoxWidth, BoxHeight, HorizonalAlignment, VerticalAlignment)
DrawString( Text, FontName, FontSize, Brush)
DrawStringFull( Text, FontName, FontSize, BoxWidth, BoxHeight, HorizonalAlignment, VerticalAlignment, Brush)
DrawImage(Image, x,y)
ScaleDrawImage( Image, x, y, Width, Height )
FillRectangle( x,y,width, height, Brush)
DrawRectangle( x,y,width, height, Pen)
FillEllipse( x,y,width, height, Brush)
DrawEllipse( x,y,width, height, Pen)
FillPie( x,y,width, height, StartAngle, SweepAngle, Brush)
DrawPie( x,y,width, height, StartAngle, SweepAngle, Pen)
OnClick( OnClick function )
OnPaint( OnPaint function )
WorkOnBuffer(bool)
CopyBufferToScreen()
SetSmoothingMode(mode)
SetInterpolationMode(mode)
Clear(color)
Destroy destroys the window
Show, shows the window
Hide, hides the window
Size, resizes the window, note: The window is not automatically redrawn!
Topmost, sets the topmost flag on the window, if true, this window will float over any other windows.
Line, draws a line
MeasureString, returns the size of the bounding box of that particular string.
MeasureStringFull, returns the size of the bounding box of that particular string.
DrawString, draws the string on the OSD
DrawStringFull, draws the string on the OSD
DrawImage, draws the Image on the OSD
ScaleDrawImage, scales and draws the image on the OSD
FillRectangle, draws a filled rectangle
DrawRectangle, draws a rectangle
FillEllipse, draws an filled ellipse
DrawEllipse, draws an ellipse
FillPie, draws a filled pie
DrawPie, draws a pie
OnClick, specifies which function should be called when the user clicks on the OSD ( function MyOnClick ( number x, number y), this allows for interactive OSDs! )
OnPaint, Drawing on the OSD is not persistent, thus it can be cleared at any momeny, the OnPaint function will be called to restore the OSD. Note that a good way around this is by drawing on the Buffer instead of the OSD, then in the OnPaint simply call CopyBufferToScreen() since the buffer is persistent. Also using the buffer is a good way to prevent screen flicker. (Double buffering).
WorkOnBuffer( boolean ), set this to true to do all the drawing in the off-screen buffer, when you are done drawing copy all of this to the main screen.
CopyBufferToScreen(), this copies the offscreen buffer to the visible OSD.
SetSmoothingMode, Sets the smoothing mode of the drawing operations.
SetInterpolationMode, set the interpolation mode of the Image scaling routines.
Clear, clears the screen in the color specified.
Image Object
The image object.
number w, number h = Image:Size()
boolean ani = Image:Animated()
Image:Animate()
Image:Pause( boolean pause )
Image:Destroy()
Call Animate if you want the image to be animated.
Pen Object
The pen, Usually used for the Drawing functions.
Pen:Destroy();
Pen:SetDashStyle(DashStyle)
Pen:SetDashCap(DashCap)
Pen:SetStartCap(LineCap)
Pen:SetEndCap(LineCap)
Brush Object
The Brush, Usually used for the Fill functions.
Brush:Destroy();
Alignment Constants
StringAlignmentNear -- Left
StringAlignmentCenter -- Center
StringAlignmentFar -- Right
Smoothing Constants
SmoothingModeDefault -- The default smoothing
SmoothingModeHighSpeed -- Fast
SmoothingModeHighQuality -- High Quality
SmoothingModeNone -- None
SmoothingModeAntiAlias - Anti Aliased
Interpolation Constants
InterpolationModeDefault -- Specifies the default interpolation mode.
InterpolationModeLowQuality -- Specifies a low-quality mode.
InterpolationModeHighQuality -- Specifies a high-quality mode.
InterpolationModeBilinear -- Specifies bilinear interpolation. No prefiltering is done. This mode is not suitable for shrinking an image below 50 percent of its original size.
InterpolationModeBicubic -- Specifies bicubic interpolation. No prefiltering is done. This mode is not suitable for shrinking an image below 25 percent of its original size.
InterpolationModeNearestNeighbor -- Specifies nearest-neighbor interpolation.
InterpolationModeHighQualityBilinear -- Specifies high-quality, bilinear interpolation. Prefiltering is performed to ensure high-quality shrinking.
InterpolationModeHighQualityBicubic -- Specifies high-quality, bicubic interpolation. Prefiltering is performed to ensure high-quality shrinking. This mode produces the highest quality transformed images.
WrapMode Constants
WrapModeTile -- Specifies tiling without flipping.
WrapModeTileFlipX -- Species that tiles are flipped horizontally as you move from one tile to the next in a row.
WrapModeTileFlipY -- Specifies that tiles are flipped vertically as you move from one tile to the next in a column.
WrapModeTileFlipXY -- Specifies that tiles are flipped horizontally as you move along a row and flipped vertically as you move along a column.
WrapModeClamp -- Specifies that no tiling takes place.
HatchStyle Constants
HatchStyleHorizontal
HatchStyleVertical
HatchStyleForwardDiagonal
HatchStyleBackwardDiagonal
HatchStyleCross
HatchStyleDiagonalCross
HatchStyle05Percent
HatchStyle10Percent
HatchStyle20Percent
HatchStyle25Percent
HatchStyle30Percent
HatchStyle40Percent
HatchStyle50Percent
HatchStyle60Percent
HatchStyle70Percent
HatchStyle75Percent
HatchStyle80Percent
HatchStyle90Percent
HatchStyleLightDownwardDiagonal
HatchStyleLightUpwardDiagonal
HatchStyleDarkDownwardDiagonal
HatchStyleDarkUpwardDiagonal
HatchStyleWideDownwardDiagonal
HatchStyleWideUpwardDiagonal
HatchStyleLightVertical
HatchStyleLightHorizontal
HatchStyleNarrowVertical
HatchStyleNarrowHorizontal
HatchStyleDarkVertical
HatchStyleDarkHorizontal
HatchStyleDashedDownwardDiagonal
HatchStyleDashedUpwardDiagonal
HatchStyleDashedHorizontal
HatchStyleDashedVertical
HatchStyleSmallConfetti
HatchStyleLargeConfetti
HatchStyleZigZag
HatchStyleWave
HatchStyleDiagonalBrick
HatchStyleHorizontalBrick
HatchStyleWeave
HatchStylePlaid
HatchStyleDivot
HatchStyleDottedGrid
HatchStyleDottedDiamond
HatchStyleShingle
HatchStyleTrellis
HatchStyleSphere
HatchStyleSmallGrid
HatchStyleSmallCheckerBoard
HatchStyleLargeCheckerBoard
HatchStyleOutlinedDiamond
HatchStyleSolidDiamond
HatchStyleTotal
LineCap Constants
LineCapFlat
LineCapSquare
LineCapRound
LineCapTriangle
LineCapNoAnchor
LineCapSquareAnchor
LineCapRoundAnchor
LineCapDiamondAnchor
LineCapArrowAnchor
DashStyle Constants
DashStyleSolid
DashStyleDash
DashStyleDot
DashStyleDashDot
DashStyleDashDotDot
DashCap Constants
DashCapFlat
DashCapRound
DashCapTriangle