Drawing

Does ihdsim support the drawing features yet I tried several things but had no result. Also do the current players support drawing or will they with a future firmware upgrade

I've tried from script:

Drawing.createColor(200,210,190,255);

Drawing.createPoint(960,540);
Drawing.createPoint(961,540);
Drawing.createPoint(962,540);
Drawing.createPoint(963,540);

Drawing.createRectangle(500,400,200,200);



Answer this question

Drawing

  • EddieOne

    Also, the default size of the drawing object canvas is 1x1, so you'll need to specify a different size to get any meaningful images.

    You'll need something like the following Markup:

    <object type="application/x-graphic" id="graphic1" style:position="absolute" style:x="10px" style:y="10px" style:width="300px" style:height="300px">
    <
    param name="width" value="300" />
    <
    param name="height" value="300" />
    </
    object>

    and something like the following script:

    var col = Drawing.createColor(50,100,200,255);
    var p1 = Drawing.createPoint(0,0);
    var p2 = Drawing.createPoint(300,300);
    var pen = Drawing.createPen(col, 3);
    var obj1 = document.graphic1;
    obj1.drawingArea.drawLine(pen, p1, p2);

    That should draw a diagonal line across the canvas.


  • Sergio Ordine

    As far as I know Drawing API is supported.

    createColor, createPoint, createRectangle etc methods are used just to create objects of particular type with particular properties.

    You'll have to use drawLine, drawRectangle and other methods of DrawingArea object (Z.7.5) to see the grafic on the screen.

    You'll have to have an <object> of type="application/x-graphic" in your markup (don't forget to give that object an id attribute), and then you will be able to access that object using AnimatedProperty API (by its id ) to invoke drawing methods and pass the correct drawing objects.


  • OhDuck

    Thanks it worked after some try's, at first it gave an error that graphic1 didn't exist yet so I added a setMarkupLoadedHandler which starts a function containing the script you mentioned and presto a nice blue line It seems a lot of work for just showing a single line.


  • Drawing