当前位置: 首页>>代码示例>>C#>>正文


C# Picture.depth方法代码示例

本文整理汇总了C#中Picture.depth方法的典型用法代码示例。如果您正苦于以下问题:C# Picture.depth方法的具体用法?C# Picture.depth怎么用?C# Picture.depth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Picture的用法示例。


在下文中一共展示了Picture.depth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Sprite

    public Sprite (float dx, float dy, int color, int width, int height,
      Picture.Format pf) {
      
      x = window.width/2;
      y = window.height/2;
      this.dx = dx;
      this.dy = dy;
      this.color = color;
      this.width = width;
      this.height = height;

      pixmap = new Pixmap (display.default_root, width, height, 
        pf.depth ());
      picture = render.create_picture (pixmap, pf,
        Picture.Attributes.EMPTY); 

      if (sprite_gc == null)
        sprite_gc = new GC (pixmap);      
    
      sprite_gc.set_foreground (0);
      pixmap.rectangle (sprite_gc, 0, 0, width, height, true);
      sprite_gc.set_foreground (color);
      pixmap.arc (sprite_gc, 0, 0, width, height, 0, 360*64, true);


      for (int i=0; i<8; i++) {
        sprite_gc.set_foreground (divide_color (color, 1<<(7-i)));
        pixmap.arc (sprite_gc, i, i, width-2*i, height-2*i, 
          0, 360*64, true);
      }
    }
开发者ID:jbnivoit,项目名称:projects,代码行数:31,代码来源:Sprites.cs


注:本文中的Picture.depth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。