protected override void Draw_PANEL_Image(BitmapData data_bac)
 {
     base.Draw_PANEL_Image(data_bac);
     PointD p = new PointD(225, 225);
     Bitmap bmp; ProduceGearImage(out bmp);
     data_bac.Paste(bmp, p - bmp.Half(), ImagePasteMode.Transparent);
     bmp = ProducePercentImage();
     data_bac.Paste(bmp, p - bmp.Half(), ImagePasteMode.Gradient);
 }
 static void Draw_Info(Block b, BitmapData data_bac)
 {
     int column = 125;
     PointD p = new PointD(BLOCK_SIZE.Width, 0);
     data_bac.Paste(b.NAME, p, Color.Yellow);
     p.X += column;
     data_bac.Paste("$" + b.PRICE.ToString(), p);
     p.X += column;
     int v = OreStorage.Get(b.NAME);
     data_bac.Paste(v.ToString() + (v == 1 ? " pc" : " pcs"), p);
     p.X += column;
     data_bac.Paste("$" + (b.PRICE * v).ToString(), p);
 }
Esempio n. 3
0
 public static void DrawImage(BitmapData data_bac)
 {
     Color c = Color.FromArgb(255, 255, 255);
     using (Font font = new Font("微軟正黑體", 20, FontStyle.Bold))
     {
         data_bac.Paste(CNT.ToString() + "/" + (LIMIT == int.MaxValue ? "∞" : LIMIT.ToString()), new Point(Background.Size.Width - 10, 10), c, font, StringAlign.Right);
     }
 }
Esempio n. 4
0
 public static void DrawImage(BitmapData data_bac)
 {
     string s = "$" + VALUE.ToString();
     Point p=new Point(280,10);
     using (Font font = new Font("微軟正黑體", 20, FontStyle.Bold))
     {
         data_bac.Paste(s, p, Color.FromArgb(255, 255, 128), font);
     }
 }
Esempio n. 5
0
 protected void DrawLOCKED(BitmapData data_bac)
 {
     if (UNLOCKED()) return;
     data_bac.Multiply_RGB(LOCK_BRIGHT_RATIO);
     using (Font font1 = new Font("微軟正黑體", 1, FontStyle.Bold))
     {
         double tilt = -Math.PI / 12.0;
         Font font2 = font1;
         "LOCKED".MaxFont(out font2, data_bac.Width, data_bac.Height, tilt, font2);
         Bitmap bmp = "LOCKED".ToBitmap(font2, Color.FromArgb(255, 255, 255)).Rotate(tilt);
         data_bac.Paste(bmp, data_bac.Half() - bmp.Half(), ImagePasteMode.Transparent);
     }
 }
Esempio n. 6
0
 void Display_Gas_Gauge(BitmapData data_bac)
 {
     double ratio = GasGauge.VALUE / GasGauge.MAXIMUM;
     Bitmap bmp = IMAGES["Full Tank"];
     Point p = IMAGE_LOCATIONS["Empty Tank"][0];
     int h = (bmp.Height * ratio).Round();
     if (h > 0)
     {
         BitmapData data_bmp = bmp.GetBitmapData(new Rectangle(new Point(0, bmp.Height - h), new Size(bmp.Width, h)));
         data_bac.Paste(data_bmp, new Point(p.X, p.Y + (bmp.Height - h)), ImagePasteMode.Transparent);
         bmp.UnlockBits(data_bmp);
     }
 }
Esempio n. 7
0
 void Display_Number_On(BitmapData data_bac, Point p, long v)
 {
     Bitmap bmp = IMAGES["Numbers"];
     Size sz = new Size(bmp.Width / 10, bmp.Height);
     bool showed = false;
     while (v > 0 || !showed)
     {
         p.X -= sz.Width;
         BitmapData data_bmp = bmp.GetBitmapData(new Rectangle(new Point((int)(sz.Width * (v % 10)), 0), sz));
         data_bac.Paste(data_bmp, p, ImagePasteMode.Gradient);
         bmp.UnlockBits(data_bmp);
         v /= 10;
         showed = true;
     }
 }
Esempio n. 8
0
 public void Draw_Exterior(BitmapData data_bac)
 {
     Bitmap bmp = Get_Exterior();
     BitmapData data_bmp = bmp.GetBitmapData();
     Point p = Background.WorldToClient(new PointD(LOCATION, 0));
     data_bac.Paste(data_bmp, new Point(p.X, p.Y - EXTERIOR.Height),ImagePasteMode.Transparent);
     bmp.UnlockBits(data_bmp);
 }
Esempio n. 9
0
 public void Draw_Image(BitmapData data_bac)
 {
     if (FORM_OPEN_STATE == 0.0) return;
     double ratio = FORM_OPEN_STATE / 100.0;
     Bitmap bmp; Get_PANEL_Image(out bmp);bmp=bmp.Resize(0.3 + 0.7 * ratio);
     if (bmp == null) return;
     BitmapData data_bmp = bmp.GetBitmapData();
     if (PublicVariables.LOW_PERFORMANCE_MODE) data_bac.Paste(data_bmp, (data_bac.Half() - data_bmp.Half()).Round,ImagePasteMode.Overwrite);
     else
     {
         data_bac.Multiply_RGB(1.0 - ratio * (1.0 - Station.FORMOPEN_BRIGHTNESS));
         data_bmp.Multiply_A(ratio);
         data_bac.Paste(data_bmp, (data_bac.Half() - data_bmp.Half()).Round,ImagePasteMode.Gradient);
     }
     bmp.UnlockBits(data_bmp);
 }
Esempio n. 10
0
 static void Draw_Text_Image(BitmapData data_ans, string s, Rectangle rect)
 {
     Bitmap bmp;
     using (Font font = new Font("微軟正黑體", 1, FontStyle.Bold))
     {
         bmp = s.ToBitmap(rect.Size, font);
     }
     Point p = (rect.Size.Half() - bmp.Size.Half()).Round;
     data_ans.Paste(bmp, POINT.Add(rect.Location, p), ImagePasteMode.Transparent);
     //bmp.Dispose();
 }
Esempio n. 11
0
 public override void DrawImage(BitmapData data_bac)
 {
     if (!VISABLE) return;
     Bitmap bmp1; GetImage(out bmp1);
     Bitmap bmp2 = bmp1.Resize(ZOOM);
     if (UNLOCKED()) bmp2.Add_RGB(LIGHT.Round());
     PointD p = GetLocation().Add(bmp1.Half());
     data_bac.Paste(bmp2, p - bmp2.Half(), ImagePasteMode.Overwrite, REGION);
     //bmp2.Dispose();
 }
Esempio n. 12
0
 public static void Draw_Image(BitmapData data_bac)
 {
     Bitmap bmp = Get_Image();
     PointD p = new PointD(200, 10);
     data_bac.Paste(bmp, p + FULL.Half() - bmp.Half(), ImagePasteMode.Gradient);
 }
Esempio n. 13
0
 public virtual void DrawImage(BitmapData data_bac)
 {
     if (!VISABLE) return;
     Bitmap bmp; GetImage(out bmp);
     data_bac.Paste(bmp, GetLocation(), IMAGE_PASTE_MODE, GetREGION());
 }
Esempio n. 14
0
 public override void DrawImage(BitmapData data_bac)
 {
     for (int i = 0; i < WEAPON.Count; i++)
     {
         WEAPON[i].DrawImage(data_bac);
     }
     base.DrawImage(data_bac);
     Bitmap bmp = GetBloodBar();
     if (bmp != null)
     {
         PointD p = GetScreenLocation().AddY(-110).Add(-bmp.Half());
         data_bac.Paste(bmp, p, ImagePasteMode.Gradient);
     }
 }
Esempio n. 15
0
 void DrawDescription(BitmapData data_bac)
 {
     Point p = new Point(100, 3*BLOCK_SIZE.Height / 4);
     Bitmap bmp = ("Description: " + DESCRIPTION.ToString()).ToBitmap(TEXTSIZE, FONT, Color.FromArgb(255, 255, 255));
     data_bac.Paste(bmp, p, ImagePasteMode.Transparent);
 }
Esempio n. 16
0
 void DrawOwned(BitmapData data_bac)
 {
     Point p = new Point(100, BLOCK_SIZE.Height / 2);
     Bitmap bmp = ("Owned: " + OWNED.ToString()).ToBitmap(TEXTSIZE, FONT, Color.FromArgb(255, 255, 255));
     data_bac.Paste(bmp, p, ImagePasteMode.Transparent);
 }
Esempio n. 17
0
 void DrawPrice(BitmapData data_bac)
 {
     Point p = new Point(100, BLOCK_SIZE.Height / 4);
     Bitmap bmp = ("Price: " + PRICE.ToString()).ToBitmap(TEXTSIZE, FONT, Color.FromArgb(255, 255, 255));
     data_bac.Paste(bmp, p, ImagePasteMode.Transparent);
 }
Esempio n. 18
0
 void DrawName(BitmapData data_bac)
 {
     Point p = new Point(100, 0);
     Bitmap bmp = ("Name: " + TEXT).ToBitmap(TEXTSIZE, FONT, Color.FromArgb(255, 255, 0));
     data_bac.Paste(bmp, p, ImagePasteMode.Transparent);
 }
Esempio n. 19
0
 public static void DrawImage(BitmapData data_bac)
 {
     Bitmap bmp; GetImage(out bmp);
     PointD p = new PointD(10, 10);
     data_bac.Paste(bmp, p, ImagePasteMode.Gradient);
 }
Esempio n. 20
0
 void Merge_Images(BitmapData data_bac,string s,Point p)
 {
     Bitmap bmp = IMAGES[s];
     //bmp = BITMAP.Recolor.Make_TrueOrFalse(bmp);
     BitmapData data_bmp = bmp.GetBitmapData();
     if (!IMAGE_LOCATIONS.ContainsKey(s)) IMAGE_LOCATIONS[s] = new List<Point>();
     IMAGE_LOCATIONS[s].Add(p);
     data_bac.Paste(data_bmp, p,ImagePasteMode.Transparent);
     bmp.UnlockBits(data_bmp);
 }
 static void Draw_Block(Block b,BitmapData data_bac)
 {
     Bitmap bmp = b.BMP_DATA.Resize(BLOCK_SIZE);
     data_bac.Paste(bmp, new Point(0, 0),ImagePasteMode.Overwrite);
 }
Esempio n. 22
0
 public override void DrawImage(BitmapData data_bac)
 {
     Bitmap bmp; GetImage(out bmp);
     if (bmp == null) return;
     data_bac.Paste(bmp, GetScreenLocation().Add(-bmp.Half()), IMAGE_PASTE_MODE, GetREGION());
 }
 void Draw_Table_Image(BitmapData data_table)
 {
     List<Block> blocks = Get_Available_Blocks();
     Point p = new Point(0, -SCROLL_POSITION.Round());
     for (int idx = 0; idx < blocks.Count; idx++, p.Y += BLOCK_SIZE.Height)
     {
         if (!p.Y.AtRange(-BLOCK_SIZE.Height + 1, LAYOUT_RECT.Size.Height - 1)) continue;
         data_table.Paste(Get_Row_Image(blocks[idx]), p,ImagePasteMode.Transparent);
     }
 }
Esempio n. 24
0
 public override void DrawImage(BitmapData data_bac)
 {
     Bitmap bmp; GetImage(out bmp);
     data_bac.Paste(bmp, LOC, IMAGE_PASTE_MODE);
 }
Esempio n. 25
0
 public static void Draw_Image(BitmapData data_bac)
 {
     Bitmap bmp; Get_Image(out bmp);
     PointD p = new PointD(130, 10);
     data_bac.Paste(bmp, p, ImagePasteMode.Gradient);
     string text;
     if (RATIO >= LOW_RATIO) text = "Fuel";
     else if (RATIO >= CRITICAL_RATIO) text = "Fuel\r\nLow";
     else text = "Fuel\r\nCritical\r\n!!!";
     Color textcolor = Color.FromArgb(0, 0, 255).Merge(Color.FromArgb(255, 255, 255), RED_VALUE);
     using (Font font = new Font("微軟正黑體", 15, FontStyle.Bold))
     {
         data_bac.Paste(text, p + bmp.Half(), textcolor, font, StringAlign.Middle, StringRowAlign.Middle);
     }
 }
Esempio n. 26
0
 public static void Draw_Image(BitmapData data_bac)
 {
     Point blocksp = Background.ClientToWorld(new Point(0, 0)).Floor;
     Point blockep = Background.ClientToWorld(new Point(data_bac.Width, data_bac.Height)).Ceiling;
     Parallel.For(blocksp.Y, blockep.Y, h =>
     {
         for (int w = blocksp.X; w < blockep.X; w++)
         {
             if (Map_NoImage(w, h)) continue;
             data_bac.Paste(Get_Block(w, h).BMP_DATA, Background.WorldToClient(new PointD(w, h)), ImagePasteMode.Overwrite);
         }
     });
     Station.DrawExteriorAll(data_bac);
     foreach (var a in OBJECTS)
     {
         a.DrawImage(data_bac);
     }
 }