Ejemplo n.º 1
0
 public static void RegisterListener(ObjectRenderer.IListener listener)
 {
     if (ObjectRenderer.m_listeners.Contains(listener))
     {
         return;
     }
     ObjectRenderer.m_listeners.Add(listener);
 }
Ejemplo n.º 2
0
        private static void GetSnapshot(out Image img, out ObjectInventory.Entry entry)
        {
            int      num;
            int      num2;
            int      num3;
            int      num4;
            Snapshot snapshot = new Snapshot(Binding.FCE_ObjectRenderer_GetSnapshot(out num, out num2, out num3, out num4));
            int      num5     = num3 - num;
            int      num6     = num4 - num2;

            if (num5 > num6)
            {
                int num7 = (num5 - num6) / 2;
                num2 -= num7;
                num4 += num7;
            }
            else
            {
                int num8 = (num6 - num5) / 2;
                num  -= num8;
                num3 += num8;
            }
            Image  image  = snapshot.GetImage();
            Bitmap bitmap = new Bitmap(256, 256);

            img = bitmap;
            using (Graphics graphics = Graphics.FromImage(img))
            {
                graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
                graphics.DrawImage(image, new Rectangle(3, 3, bitmap.Width - 6, bitmap.Height - 6), new Rectangle(num, num2, num3 - num, num4 - num2), GraphicsUnit.Pixel);
            }
            entry = new ObjectInventory.Entry(Binding.FCE_ObjectRenderer_GetSnapshotEntry());
            Directory.CreateDirectory(ObjectRenderer.cachePath);
            try
            {
                ObjectRenderer.WritePNG(ObjectRenderer.cachePath + entry.Id + ".png", bitmap);
            }
            catch (Exception)
            {
            }
        }
Ejemplo n.º 3
0
 public static void UnregisterListener(ObjectRenderer.IListener listener)
 {
     ObjectRenderer.m_listeners.Remove(listener);
 }
Ejemplo n.º 4
0
 public static void ResizeThumbnails()
 {
     ObjectRenderer.ResizeThumbnails("pc", 256, 256, Color.FromArgb(0, 127, 127, 127));
     ObjectRenderer.ResizeThumbnails("console", 128, 256, Color.FromArgb(0, 32, 32, 32));
 }