C# Bitmap.MakeTransparent方法代码示例

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


C# Bitmap.MakeTransparent方法代码示例

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

示例1: LoadContent

 public override void LoadContent()
        {
            _font = Resources.GetFont(Resources.FontResources.NinaB);

              var tempSheet = Resources.GetBitmap(Resources.BitmapResources.pacman);
              _spriteSheet = new Bitmap(tempSheet.Width, tempSheet.Height);
              _spriteSheet.DrawImage(0, 0, tempSheet, 0, 0, tempSheet.Width, tempSheet.Height);
              _spriteSheet.MakeTransparent(Microsoft.SPOT.Presentation.Media.Color.Black);

              _maze = new Maze();
              _maze.Draw(Surface, Host);

              _pacman = new Player(_spriteSheet, _maze);

              #region Initialize Bonus Point Sprites
              _bonus200 = new Sprite(new AnimationSequence(_spriteSheet, 0,
            new Rect[] { new Rect(80, 104, 16, 8) }));

              _bonus400 = new Sprite(new AnimationSequence(_spriteSheet, 0,
            new Rect[] { new Rect(96, 104, 16, 8) }));

              _bonus800 = new Sprite(new AnimationSequence(_spriteSheet, 0,
            new Rect[] { new Rect(112, 104, 16, 8) }));

              _bonus1600 = new Sprite(new AnimationSequence(_spriteSheet, 0,
            new Rect[] { new Rect(128, 104, 16, 8) }));

              _bonus100 = new Sprite(new AnimationSequence(_spriteSheet, 0,
            new Rect[] { new Rect(0, 112, 16, 8) }));

              _bonus300 = new Sprite(new AnimationSequence(_spriteSheet, 0,
            new Rect[] { new Rect(16, 112, 16, 8) }));

              _bonus500 = new Sprite(new AnimationSequence(_spriteSheet, 0,
            new Rect[] { new Rect(32, 112, 16, 8) }));

              _bonus700 = new Sprite(new AnimationSequence(_spriteSheet, 0,
            new Rect[] { new Rect(48, 112, 16, 8) }));

              _bonus1000 = new Sprite(new AnimationSequence(_spriteSheet, 0,
            new Rect[] { new Rect(64, 112, 20, 8) }));

              _bonus2000 = new Sprite(new AnimationSequence(_spriteSheet, 0,
            new Rect[] { new Rect(84, 112, 20, 8) }));

              _bonus3000 = new Sprite(new AnimationSequence(_spriteSheet, 0,
            new Rect[] { new Rect(106, 112, 20, 8) }));

              _bonus5000 = new Sprite(new AnimationSequence(_spriteSheet, 0,
            new Rect[] { new Rect(128, 112, 16, 8) }));
              #endregion

              #region Initialize Ghosts
              _blinky = new Ghost(_spriteSheet, _maze, _pacman, 16,
            new Personality()
            {
              ScatterX = 13 * 16,
              ScatterY = -2 * 16,
              TargetOffsetX = 0,
              TargetOffsetY = 0,
              HouseX = 7 * 16,
              HouseY = 7 * 16,
              StartX = 7 * 16,
              StartY = 5 * 16
            });
              _blinky.CurrentDirection = Direction.Left;

              _pinky = new Ghost(_spriteSheet, _maze, _pacman, 32,
            new Personality()
            {
              ScatterX = 1 * 16,
              ScatterY = -2 * 16,
              TargetOffsetX = 4 * 16,
              TargetOffsetY = 0,
              HouseX = 6 * 16,
              HouseY = 7 * 16,
              StartX = 6 * 16,
              StartY = 7 * 16
            });
              _pinky.CurrentDirection = Direction.Left;

              _inky = new Ghost(_spriteSheet, _maze, _pacman, 48,
            new Personality()
            {
              ScatterX = 14 * 16,
              ScatterY = 15 * 16,
              TargetOffsetX = -3 * 16,
              TargetOffsetY = 0,
              HouseX = 7 * 16,
              HouseY = 7 * 16,
              StartX = 7 * 16,
              StartY = 7 * 16
            });
              _inky.CurrentDirection = Direction.Left;

              _clyde = new Ghost(_spriteSheet, _maze, _pacman, 64,
            new Personality()
            {
              ScatterX = 0 * 16,
              ScatterY = 15 * 16,
//.........这里部分代码省略.........
开发者ID:ianlee74,项目名称:Gadgeteer,代码行数:101,代码来源:PacmanGame.cs

示例2: EditDesktop

 private EditDesktop()
        {
            _lastDesktop = null;

            Suspended = true;

            _bmpEnter = Mp.Ui.Resources.Images.GetBitmap(Resources.Images.BitmapResources.enter);
            _bmpEnter.MakeTransparent(Colors.Fuchsia);
            Utils.ChangeBitmapColor(_bmpEnter, Colors.Fuchsia, StyleManager.CurrentStyle.ButtonEnabledTextColor);

            _bmpBackspace = Mp.Ui.Resources.Images.GetBitmap(Resources.Images.BitmapResources.backspace);
            _bmpBackspace.MakeTransparent(Colors.Fuchsia);
            Utils.ChangeBitmapColor(_bmpBackspace, Colors.Fuchsia, StyleManager.CurrentStyle.ButtonEnabledTextColor);

            StyleManager.StyleChanged += (oldStyle, newStyle) =>
            {
                Utils.ChangeBitmapColor(_bmpEnter, Colors.Fuchsia, newStyle.ButtonEnabledTextColor);
                Utils.ChangeBitmapColor(_bmpBackspace, Colors.Fuchsia, newStyle.ButtonEnabledTextColor);
            };

            CreateCommonLayout();

            int panelHeight = _height - _doneButton.ScreenBottom - _uiMargin;

            CreateQwertyLayout(_qwertyPanel = new Panel(0, _height - panelHeight, _width, panelHeight));
            CreateNumericLayout(_numericPanel = new Panel(0, _height - panelHeight, _width, panelHeight) { _visible = false });

            base.AddChild(_qwertyPanel);
            base.AddChild(_numericPanel);

            _ignoreAllowedCharsChanges = true;
            AllowedCharTypes = AllowedCharTypesEnum.All;
            _ignoreAllowedCharsChanges = false;
        }
开发者ID:andrei-tatar,项目名称:MediaPlayer.NETMF,代码行数:34,代码来源:EditDesktop.cs

本文标签属性:

示例:示例的拼音

代码:代码零九

Bitmap:Bitmap

MakeTransparent:MakeTransparent

上一篇:禁赛是什么意思,禁赛的拼音怎么写,禁赛怎么读(禁赛是什么意思)
下一篇:Java ProxyServer.setResponseVolatile方法代码示例

为您推荐