• html 绘图




    <html>
    <head>
    <title>canvas绘制图形</title>
        <style>
            body{
                margin: 0px;
                padding: 0px;
            }
            #mycanvas{
                border: 1px solid #9c9898;
                
            }
            
        </style>
        <script type=text/javascript >
            window.onload=function(){
                var  ca=document.getElementById("mycanvas");
                var context=ca.getContext("2d");
                context.fillStyle="#ff0000";
                context.fillRect(200,50,100,100);
        
    
    
            }
        </script>
    <body>
        <canvas id ="mycanvas" width="500" height="200">
            浏览器不支持
        </canvas>
    </body>
    </head>
    </html>

    绘制直线:

    <html>
    <head>
    <title>canvas绘制图形</title>
        <style>
            body{
                margin: 0px;
                padding: 0px;
            }
            #mycanvas{
                border: 1px solid #9c9898;
                
            }
            
        </style>
        <script type=text/javascript >
            window.onload=function(){
                var  ca=document.getElementById("mycanvas");
                var context=ca.getContext("2d");
                context.beginPath();
                context.moveTo(20, 220);
                context.lineTo(500,220);
                context.lineWidth=20;
                context.strokeStyle="#ff0000";
                context.stroke();
        
    
    
            }
        </script>
    <body>
        <canvas id ="mycanvas" width="500" height="300">
            浏览器不支持
        </canvas>
    </body>
    </head>
    </html>

    绘制曲线

     

  • 相关阅读:
    阅读计划博文
    系统设计时所实现的质量属性战术
    关于如何提高系统的可用性和易用性
    jdbc.properties
    JDBCUtil
    软件质量属性的场景描述
    架构漫谈阅读笔记
    软件架构师工作过程
    orm框架中entityframework的 增删改查操作
    事件和委托
  • 原文地址:https://www.cnblogs.com/superxuezhazha/p/5703373.html
Copyright © 2020-2023  润新知