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); } }
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; }
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); } } }