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


C# Bitmap.Paste方法代码示例

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


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

示例1: GetImage

 protected override void GetImage(out Bitmap bac)
 {
     if (TEXT.IndexOf("Blade") != -1 || TEXT.IndexOf("Swashplate") != -1)
     {
         double time = Game.TIME;
         double angle = time;
         if (TEXT.IndexOf("Blade") != -1)
         {
             double limit = UpgradeInfo.DataBase.BladeUpgradeValues[INDEX];
             if (limit != double.MaxValue)
             {
                 angle %= 2.0 * limit;
                 if (angle > limit) angle = 2.0 * limit - angle;
                 angle -= 0.5 * limit;
             }
             angle *= 2.0;
         }
         else if (TEXT.IndexOf("Swashplate") != -1)
         {
             angle = 0.5 * Math.Cos(Math.PI * time / UpgradeInfo.DataBase.SwashplateUpgradeValues[INDEX]) * Math.PI;
         }
         Bitmap bmp = Pod_Frame.Pod.GenerateImage(angle, Math.PI * Game.TIME);
         BITMAP.New(out bac,50, 50, Color.FromArgb(0, 0, 128));
         bac.Paste(bmp, bac.Half() - bmp.Half(), ImagePasteMode.Transparent);
         bac = bac.Resize(2.0);
         BitmapData data_bac = bac.GetBitmapData();
         DrawLOCKED(data_bac);
         bac.UnlockBits(data_bac);
     }
     else
     {
         Bitmap bmp; base.GetImage(out bmp);
         BITMAP.New(out bac,bmp.Width, bmp.Height, Color.FromArgb(0, 0, 128));
         bac.Paste(bmp, new Point(0, 0), ImagePasteMode.Transparent);
     }
 }
开发者ID:fsps60312,项目名称:Digging-Game-2,代码行数:36,代码来源:Upgrade+Plant.cs

示例2: Get_Image

 static Bitmap Get_Image(out Bitmap bac)
 {
     bac = new Bitmap(EMPTY);
     BitmapData data_bac = bac.GetBitmapData();
     if (VALUE >= CRITICAL_SHRINK * MAXIMUM)
     {
         using (Bitmap bmp1 = new Bitmap(FUEL))
         {
             double ratio = (VALUE / MAXIMUM - CRITICAL_SHRINK) / (1.0 - CRITICAL_SHRINK);
             int y = (int)Math.Round(DOWN_Y * (1.0 - ratio));
             bmp1.Paste(TOP_SURFACE, new Point(0, y), ImagePasteMode.Transparent);
             using (Bitmap bmp2 = bmp1.SubBitmap(new Rectangle(0, y, bmp1.Width, bmp1.Height - y)).Transparentize(Color.FromArgb(255, 255, 255)))
             {
                 data_bac.Paste(bmp2, new Point(1, 1 + y), ImagePasteMode.Transparent);
             }
         }
         data_bac.Paste(FRAME, new Point(0, 0), ImagePasteMode.Transparent);
     }
     else
     {
         Bitmap bmp = TOP_SURFACE.Resize(VALUE / MAXIMUM / CRITICAL_SHRINK);
         if (bmp != null)
         {
             bmp = bmp.Transparentize(Color.FromArgb(255, 255, 255));
             data_bac.Paste(bmp, new PointD(1, 1 + DOWN_Y) + TOP_SURFACE.Half() - bmp.Half(), ImagePasteMode.Transparent);
             //bmp.Dispose();
         }
         data_bac.Paste(FRAME, new Point(0, 0), ImagePasteMode.Transparent);
     }
     data_bac.Add_R_Minus_GB((RED_VALUE * 100.0).Round());
     bac.UnlockBits(data_bac);
     return bac;
 }
开发者ID:fsps60312,项目名称:Digging-Game-2,代码行数:33,代码来源:Gas+Gauge.cs

示例3: Get_Image

 public static void Get_Image(out Bitmap bac)
 {
     Background.Get_Image(out bac);
     if(EARTHQUAKE>0.0)
     {
         Pod.PAUSED = true;
         bac.Merge_RGB(Color.FromArgb(0, 0, 0), EARTHQUAKE);
         Bitmap bmp;
         using (Font font = new Font("微軟正黑體", 40, FontStyle.Bold))
         {
             bmp = "EARTHQUAKE!!!".ToBitmap(font, Color.FromArgb(255, 255, 255));
         }
         bac.Paste(bmp.Multiply_A(EARTHQUAKE), bac.Half() - bmp.Half(), ImagePasteMode.Gradient);
         //bmp.Dispose();
     }
     else if (FORM_CLOSING)
     {
         Bitmap bmp; Get_GoodBye_Image(out bmp);
         if (FORM_CLOSING_TIME >= FORM_CLOSING_PERIOD) System.Diagnostics.Process.GetCurrentProcess().Kill();
         else if (FORM_CLOSING_TIME >= FORM_CLOSING_MERGE_PERIOD) bac = bmp;
         else
         {
             double ratio = FORM_CLOSING_TIME / FORM_CLOSING_MERGE_PERIOD;
             bmp = bmp.Multiply_A(ratio);
             bac = bac.Paste(bmp, new Point(0, 0), ImagePasteMode.Gradient);
         }
     }
 }
开发者ID:fsps60312,项目名称:Digging-Game-2,代码行数:28,代码来源:Game.cs


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