Page 1 of 3 123 LastLast
Results 1 to 10 of 30

Thread: New OSD!

  1. #1
    Join Date
    Dec 2001
    Posts
    11,560

    Default New OSD!

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

    Call Animate if you want the image to be animated.

    Pen Object
    The pen, Usually used for the Drawing functions.

    Penestroy();
    Pen:SetDashStyle(DashStyle)
    Pen:SetDashCap(DashCap)
    Pen:SetStartCap(LineCap)
    Pen:SetEndCap(LineCap)

    Brush Object
    The Brush, Usually used for the Fill functions.

    Brushestroy();

    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

  2. #2
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    12,305

    Default

    Ehm Mike, I don't think I released this one yet :-)
    Ron
    No support through PM

  3. #3
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    12,305

    Default

    For people that can't wait for the next release, this OSD is REALLY NEAT!
    Attached Files Attached Files
    Ron
    No support through PM

  4. #4
    Join Date
    May 2004
    Posts
    2,583

    Default

    :-?
    I think I'll wait.
    So everything needs to be scripted in LUA?

  5. #5
    Join Date
    Dec 2001
    Posts
    11,560

    Default

    yes, too many options for the a tree.

  6. #6
    Join Date
    May 2004
    Posts
    2,583

    Default

    It would be great to see some working practical examples, whenever you have the opportunity. I find it easier to learn from examples than from instructions most of the time.

  7. #7
    Join Date
    Dec 2001
    Posts
    11,560

    Default

    Attached Files Attached Files

  8. #8
    father of monstermagnet Guest

    Default

    Does

    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! )
    mean you can create as many buttons you like ?

    The end of IEApp and Htmlosd ?

  9. #9
    Join Date
    Dec 2001
    Posts
    11,560

    Default

    You can use it this way if you want...

  10. #10
    Join Date
    May 2004
    Posts
    2,583

    Default

    Wow! I finally had a chance to look at the example, and it is really cool. The possibilities!

    I particularly like the animated .GIF functionality.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •