Exemple #1
0
        public string GrabScreen(string assign = "")
        {
            try {
                var tag = assign;
                var at  = 0;
                if (tag == "")
                {
                    do
                    {
                        at++; tag = $"IMAGE:{at}";
                    } while (Images.ContainsKey(tag));
                }
                Images[tag] = TQMG.GrabImage();
                if (Images[tag] == null)
                {
                    throw new Exception("Grabbed image == null!");
                }
                return(tag);
            } catch (Exception Catastrophe) {
#if DEBUG
                SBubble.MyError($"Bubble.Graphics.Images.Grab(\"{assign}\")", Catastrophe.Message, $"{SBubble.TraceLua(vm)}\n\n.NET Traceback:\n{Catastrophe.StackTrace}");
#else
                SBubble.MyError($"Bubble.Graphics.Images.Grab(\"{assign}\")", Catastrophe.Message, $"{SBubble.TraceLua(vm)}");
#endif
                return("Il ya une catastrophe");
            }
        }
Exemple #2
0
        public string GrabPart(int x, int y, int w, int h, string assign = "")
        {
            try {
                var tag = assign;
                var at  = 0;
                if (tag == "")
                {
                    do
                    {
                        at++; tag = $"IMAGE:{at}";
                    } while (Images.ContainsKey(tag));
                }
                Images[tag] = TQMG.GrabImage(x, y, w, h);
                return(tag);
            } catch (Exception Catastrophe) {
#if DEBUG
                SBubble.MyError($"Bubble.Graphics.Images.Grab(\"{assign}\",{x},{y},{w},{h})", Catastrophe.Message, $"{SBubble.TraceLua(vm)}\n\n.NET Traceback:\n{Catastrophe.StackTrace}");
#else
                SBubble.MyError($"Bubble.Graphics.Images.Grab(\"{assign}\",{x},{y},{w},{h})", Catastrophe.Message, $"{SBubble.TraceLua(vm)}");
#endif
                return("Il ya une catastrophe");
            }
        }