zoukankan      html  css  js  c++  java
  • Canvas 图形

    The command $widget -> create type options is used to make different structures A few examples are given
    below For more information read the manual
    Example
    #!/usr/local/bin/perl
    use Tk;
    # Main Window
    my $mw = new MainWindow;
    my $cns = $mw -> Canvas(-relief=>"sunken", -background=>"blue");
    $cns -> create('polygon',5,100,50,5,150,5,200,100,5,100,
    -joinstyle=>"bevel", -fill=>"red", -outline=>"white", -width=>5);
    $cns -> create('oval',200,100,300,200, -fill=>"green");
    $cns -> create('oval',100,150,300,100, -fill=>"white", -width=>0);
    $cns -> create('rectangle',10,150,100,250, -dash=>[6,4,2,4,2,4]);
    $cns -> pack;
    MainLoop;
    
    
    
    #!/usr/local/bin/perl
    use Tk;
    # Main Window
    my $mw = new MainWindow;
    my $cns = $mw -> Canvas(-relief=>"xxx", -background=>"blue");
    $cns -> create('polygon',5,100,50,5,150,5,200,100,5,100,
    -joinstyle=>"bevel", -fill=>"red", -outline=>"white", -width=>5);
    
    $cns -> create('oval',200,100,300,200, -fill=>"green");
    $cns -> create('oval',100,150,300,100, -fill=>"white", -width=>0);
    $cns -> create('rectangle',10,150,100,250, -dash=>[6,4,2,4,2,4]);
    $cns -> pack;
    MainLoop;
    
    -relief=>"xxx":
    
    
    bad relief type "xxx": must be flat, groove, raised, ridge, solid, or sunken at
    C:/Perl/site/lib/Tk/Widget.pm line 205.
     at tx.pl line 5.
    
    
    polygon 多边形
    
    oval 椭圆形
    
    rectangle 矩形
    

  • 相关阅读:
    计算机编程语言有哪些?
    JS/Jquery遍历JSON对象、JSON数组、JSON数组字符串、JSON对象字符串
    原生js弹力球
    js中的位置属性
    javascript中常见的表单验证项
    深入理解系统调用
    计一次后怕的排错经历
    Oracle 11G ASM新加磁盘无法init disk
    Oracle需要清理的日志
    openstack-neutron
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13351898.html
Copyright © 2011-2022 走看看