Ejemplo n.º 1
0
        public Guid StartSearch(Item item, DateTime beginTime, DateTime endTime, int sensitivity, TimeSpan duration, String maskString, int maskHeight, int maskWidth)
        {
            Item   recorderItem    = item.GetParent();
            String recorderAddress = recorderItem.FQID.ServerId.Uri.ToString();

            String serverUri = String.Format("{0}RecorderCommandService/RecorderCommandService.asmx", recorderAddress);

            rcs.Url = serverUri;

            LoginSettings ls           = LoginSettingsCache.GetLoginSettings(EnvironmentManager.Instance.MasterSite.ServerId.Id);
            TimeDuration  timeDuration = new TimeDuration()
            {
                MicroSeconds = Convert.ToInt64(duration.TotalMilliseconds * 1000)
            };
            Size size = new Size()
            {
                Height = maskHeight, Width = maskWidth
            };
            ImageMask imageMask = new ImageMask()
            {
                Mask = maskString, Size = size
            };

            return(rcs.SmartSearchStart(ls.Token, item.FQID.ObjectId, beginTime, endTime, sensitivity, timeDuration, imageMask, true, new Size()
            {
                Width = 320, Height = 200
            }));
        }
Ejemplo n.º 2
0
    public bool[] GetContinueImageData()
    {
        if (m_data == null || string.IsNullOrEmpty(m_data.ContinueImageData))
        {
            return(null);
        }


        return(ImageMask.Decode(m_data.ContinueImageData));
    }
Ejemplo n.º 3
0
        public ImageViewModel()
        {
            _backCommand = new Command (BackCommandExecute);
            _confirmCommand = new Command (ConfirmCommandExecute);

            _panCommand = new Command (PanCommandExecute);
            _pinchCommand = new Command (PinchCommandExecute);

            _mask = new ImageMask (new Rectangle (
                0.2,
                0.2,
                0.6,
                0.6));
        }
Ejemplo n.º 4
0
    public void SaveProgress(float time, bool[] tiles)
    {
        m_data.ContinueTime = Utils.SecondsToMs(time);

        var imageProgressData = ImageMask.Encode(tiles);

        if (imageProgressData == null)
        {
            return;
        }

        m_data.ContinueImageData = imageProgressData;
        m_data.Steps             = Base64Serializer.Encode(m_steps.ToArray());
    }
Ejemplo n.º 5
0
        public ImageViewModel()
        {
            _backCommand    = new Command(BackCommandExecute);
            _confirmCommand = new Command(ConfirmCommandExecute);

            _panCommand   = new Command(PanCommandExecute);
            _pinchCommand = new Command(PinchCommandExecute);

            _mask = new ImageMask(new Rectangle(
                                      0.2,
                                      0.2,
                                      0.6,
                                      0.6));
        }
        public BoardCameraHandler()
        {
            ImageProvider = new DrawingImageProvider();
            Connector     = new MediaConnector();

            _imageMask            = new ImageMask();
            _imageMask.MaskColor  = Color.Black;
            _imageMask.Difference = 100;
            _imageMask.MaskOption = MaskOption.Foreground;

            bmpImg = new Bitmap(180, 135);
            bmpImg.SetResolution(100, 100);

            grfx = Graphics.FromImage(bmpImg);
        }
Ejemplo n.º 7
0
        public void UpdateMinMaxHeight()
        {
            SessionManager.GetWorldMinMax(ref m_minWorldHeight, ref m_maxWorldHeight, false);
            float seaLevel = SessionManager.GetSeaLevel(false);

            //Iterate through all image masks and set up the current min max height
            //This is fairly important to display the height-dependent mask settings correctly
            foreach (ImageMask mask in m_settings.m_imageMasks)
            {
                mask.m_maxWorldHeight = m_maxWorldHeight;
                mask.m_minWorldHeight = m_minWorldHeight;
                mask.m_seaLevel       = seaLevel;
            }
            ImageMask.CheckMaskStackForInvalidTextureRules("Biome Controller", this.name, m_settings.m_imageMasks);
        }
Ejemplo n.º 8
0
        public LegendItemViewModel Clone()
        {
            LegendItemViewModel newItem = new LegendItemViewModel
            {
                NotifiedGeoFont        = NotifiedGeoFont.Clone(),
                BackgroundMask         = BackgroundMask == null ? null : (AreaStyle)BackgroundMask.CloneDeep(),
                BottomPadding          = BottomPadding,
                Height                 = Height,
                ImageBottomPadding     = ImageBottomPadding,
                ImageHeight            = ImageHeight,
                ImageJustificationMode = ImageJustificationMode,
                ImageLeftPadding       = ImageLeftPadding,
                ImageMask              = ImageMask == null ? null : (AreaStyle)ImageMask.CloneDeep(),
                ImageRightPadding      = ImageRightPadding,
                //ImageStyle = ImageStyle.CloneDeep(),
                ImageTopPadding   = ImageTopPadding,
                ImageWidth        = ImageWidth,
                LeftPadding       = LeftPadding,
                LegendItemType    = LegendItemType,
                TextBottomPadding = TextBottomPadding,
                TextLeftPadding   = TextLeftPadding,
                TextMask          = TextMask == null ? null : (AreaStyle)TextMask.CloneDeep(),
                TextRightPadding  = TextRightPadding,
                TextSolidBrush    = TextSolidBrush,
                TextTopPadding    = TextTopPadding,
                Text       = this.Text,
                TopPadding = TopPadding,
                Width      = Width,
                Parent     = Parent
            };

            if (ImageStyle != null)
            {
                newItem.ImageStyle = ImageStyle.CloneDeep();
            }

            return(newItem);
        }
Ejemplo n.º 9
0
        public void Init(ImageMask imageMask = null)
        {
            allBiomeController = (BiomeController[])Resources.FindObjectsOfTypeAll(typeof(BiomeController));
            allStampers        = (Stamper[])Resources.FindObjectsOfTypeAll(typeof(Stamper));
            allSpawners        = (Spawner[])Resources.FindObjectsOfTypeAll(typeof(Spawner));

            m_categoryNames.Clear();
            var info     = new DirectoryInfo(GaiaDirectories.GetStampDirectory());
            var fileInfo = info.GetDirectories();

            foreach (DirectoryInfo dir in fileInfo)
            {
                m_categoryNames.Add(dir.Name);
            }

            //Do the same with the user stamp folder
            info     = new DirectoryInfo(GaiaDirectories.GetUserStampDirectory());
            fileInfo = info.GetDirectories();
            foreach (DirectoryInfo dir in fileInfo)
            {
                m_categoryNames.Add(dir.Name);
            }

            m_categoryNames.Sort();

            if (imageMask != null)
            {
                m_editedImageMask = imageMask;
            }

            //read & store the original texture guid if the user wants to cancel
            if ((m_editedImageMask != null && m_editedImageMask.ImageMaskTexture != null))
            {
                string pathToImage = "";
                if (m_editedImageMask != null)
                {
                    pathToImage = AssetDatabase.GetAssetPath(m_editedImageMask.ImageMaskTexture);
                }
                //else
                //{
                //    pathToImage = AssetDatabase.GetAssetPath(m_editedStamperSettings.m_stamperInputImage);
                //}
                m_originalTextureGUID = AssetDatabase.AssetPathToGUID(pathToImage);
                m_previewTexture      = (Texture2D)AssetDatabase.LoadAssetAtPath(pathToImage, typeof(Texture2D));

                //Try to locate the selected image in the stamps directory
                if (pathToImage.Contains(GaiaDirectories.STAMP_DIRECTORY))
                {
                    string lastFolderName = Path.GetFileName(Path.GetDirectoryName(pathToImage));
                    m_selectedCategoryID = m_categoryNames.FindIndex(x => x == lastFolderName);
                    LoadStampDirFileInfo();
                    int index = -1;
                    foreach (var fi in m_currentStampDirFileInfo)
                    {
                        index++;
                        if (pathToImage.Contains(fi.Name))
                        {
                            m_currentStampIndex = index;
                        }
                    }
                }
            }
            else
            {
                m_originalTextureGUID = "";
            }
        }