Exemple #1
0
        private void DrawAugmentatedImage()
        {
            Image <Bgr, Byte> res = BigImage.Clone();

            res[1]   = res[1] + MaskImage.ThresholdBinary(new Gray(1), new Gray(100));
            AugImage = res;
        }
Exemple #2
0
        public Task <HttpResponseMessage> GetBigImage(BigImage bigImage)
        {
            ResponseBase <string> response = new ResponseBase <string>();

            try
            {
                UploadFileObj uploadFileObj = new UploadFileObj()
                {
                    MsgId          = bigImage.MsgId,
                    MsgType        = 3,
                    WxId           = bigImage.WxId,
                    ToWxId         = bigImage.ToWxId,
                    LongDataLength = bigImage.LongDataLength,
                };
                string objName = QueueHelper <UploadFileObj> .Work(uploadFileObj);

                response.Data = objName;
            }
            catch (ExpiredException ex)
            {
                response.Success = false;
                response.Code    = "401";
                response.Message = ex.Message;
            }
            catch (Exception ex)
            {
                response.Success = false;
                response.Code    = "500";
                response.Message = ex.Message;
            }
            return(response.ToHttpResponseAsync());
        }
Exemple #3
0
    // Use this for initialization
    void Start()
    {
        textToSpeech = GameObject.Find("Audio Manager").GetComponent <TextToSpeech>();
        bigImage     = GetComponent <BigImage>();
        readAIM      = GameObject.FindGameObjectWithTag("Manager").GetComponent <ReadAIMFile>();
        values       = readAIM.Values;
        //allImagesForFrames = readAIM.Frames;
        bigFrameImage = GetComponent <Image>();

        maxGraphValue = new float[1024];
        minGraphValue = new float[1024];

        Debug.Log("CreateGraph Start!");
        foreach (var frame in values)
        {
            Debug.Log(frame[500]);
            int i = 0;
            foreach (var point in frame)
            {
                if (point > maxGraphValue[i])
                {
                    maxGraphValue[i] = point;
                }
                else if (point < minGraphValue[i])
                {
                    minGraphValue[i] = point;
                }
                i++;
            }
        }
    }
        public void Bind(string name, string name2, string name3, string description, string repoOwner, GitHubAvatar imageUrl)
        {
            Caption.Text       = name;
            Label1.Text        = name2;
            Label3.Text        = name3;
            Description.Hidden = description == null;
            Description.Text   = description ?? string.Empty;

            RepoName.Hidden  = repoOwner == null;
            UserImage.Hidden = RepoName.Hidden;
            RepoName.Text    = repoOwner ?? string.Empty;

            BigImage.Image = Images.Avatar;

            try
            {
                var uri = imageUrl.ToUri(64)?.AbsoluteUri;
                if (uri != null)
                {
                    BigImage.SetImage(new NSUrl(uri), Images.Avatar);
                }
            }
            catch
            {
            }
        }
Exemple #5
0
 // Use this for initialization
 void Start()
 {
     bigFrameGameObject    = GameObject.FindGameObjectWithTag("BigFrame");
     bigFrameImage         = bigFrameGameObject.GetComponent <Image>();
     bigImage              = bigFrameGameObject.GetComponent <BigImage>();
     bigFrameImage.enabled = false;
     myImage = GetComponent <Image>();
 }
Exemple #6
0
        void ReleaseDesignerOutlets()
        {
            if (BigImage != null)
            {
                BigImage.Dispose();
                BigImage = null;
            }

            if (Caption != null)
            {
                Caption.Dispose();
                Caption = null;
            }

            if (Description != null)
            {
                Description.Dispose();
                Description = null;
            }

            if (Image1 != null)
            {
                Image1.Dispose();
                Image1 = null;
            }

            if (Image3 != null)
            {
                Image3.Dispose();
                Image3 = null;
            }

            if (Label1 != null)
            {
                Label1.Dispose();
                Label1 = null;
            }

            if (Label3 != null)
            {
                Label3.Dispose();
                Label3 = null;
            }

            if (RepoName != null)
            {
                RepoName.Dispose();
                RepoName = null;
            }

            if (UserImage != null)
            {
                UserImage.Dispose();
                UserImage = null;
            }
        }
 public void Dispose()
 {
     OriginalImage?.Dispose();
     OriginalImage = null;
     BigImage?.Dispose();
     BigImage = null;
     SmallImage?.Dispose();
     SmallImage = null;
     TinyImage?.Dispose();
     TinyImage = null;
     XtraTinyImage?.Dispose();
     XtraTinyImage = null;
 }
Exemple #8
0
    // Use this for initialization
    void Start()
    {
        textToSpeech = GameObject.Find("Audio Manager").GetComponent <TextToSpeech>();
        bigImage     = GetComponent <BigImage>();
        readAIM      = GameObject.FindGameObjectWithTag("Manager").GetComponent <ReadAIMFile>();

        allImagesForFrames = readAIM.Frames;
        bigFrameImage      = GetComponent <Image>();

        //string text = "some text to say....";
        //textToSpeech.StartSpeaking(text);
        //textToSpeech.StopSpeaking();
    }
Exemple #9
0
        public Task <HttpResponseMessage> GetBigImage(BigImage bigImage)
        {
            ResponseBase <string> response = new ResponseBase <string>();

            try
            {
                UploadFileObj uploadFileObj = new UploadFileObj()
                {
                    MsgId          = bigImage.MsgId,
                    MsgType        = 3,
                    WxId           = bigImage.WxId,
                    ToWxId         = bigImage.ToWxId,
                    LongDataLength = bigImage.LongDataLength,
                };
                string mchId = RedisCache.CreateInstance().Get(ConstCacheKey.GetMchIdKey(uploadFileObj.WxId));
                if (string.IsNullOrEmpty(mchId))
                {
                    throw new Exception("未初始化商户Ip");
                }
                string objName = $"{FileStorageHelper.GetObjectName(mchId)}{uploadFileObj.MsgId}.png";

                var     producer = RocketMqHelper.CreateDefaultMQProducer(MqConst.UploadOssProducerGroup);
                var     buffer   = Encoding.UTF8.GetBytes(uploadFileObj.ToJson());
                Message message  = new Message(MqConst.UploadOssTopic, buffer);
                producer.SendMessage(message);



                response.Data = objName;
            }
            catch (ExpiredException ex)
            {
                response.Success = false;
                response.Code    = "401";
                response.Message = ex.Message;
            }
            catch (Exception ex)
            {
                response.Success = false;
                response.Code    = "500";
                response.Message = ex.Message;
            }
            return(response.ToHttpResponseAsync());
        }
Exemple #10
0
        /// <summary>
        /// 图片点击事件 选择图片
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void picuser_Click(object sender, EventArgs e)
        {
            string strIUrl = CommonCtrl.IsNullToString(picuser.ImageLocation);

            if (!string.IsNullOrEmpty(strIUrl))
            {
                Image img = null;
                if (windowStatus == WindowStatus.Edit || windowStatus == WindowStatus.Copy)
                {
                    img = FileOperation.DownLoadImage(strIUrl);//图片信息
                }
                else
                {
                    img = new Bitmap(strIUrl);
                }
                if (img != null)
                {
                    BigImage bigimage = new BigImage(img);
                    bigimage.ShowDialog();
                }
            }
        }
Exemple #11
0
 private void Awake()
 {
     bigImage   = this.GetComponent <BigImage>();
     quitButton = this.transform.GetChild(0).GetComponent <Button>();
 }
 public void PrepareOutputFile()
 {
     OutputFilePath = Path.GetTempFileName();
     BigImage.Save(OutputFilePath);
 }
Exemple #13
0
            public BigImage ConstructImage()
            {
                // // square tiles
                var gridSize = (int)Math.Sqrt(AllTiles.Count());

                // Get all edges and store each tile that belongs to that edge!
                var tileByEdges = new Dictionary <string, List <Tile> >(
                    AllTiles.SelectMany(tile => tile.Edges.Select(edge => new { edge, tile }))
                    .GroupBy(val => val.edge)
                    .Where(val => val.Count() > 1) // only interested in edges that has more than one connection!
                    .Select(val => new KeyValuePair <string, List <Tile> >(val.Key, val.Select(i => i.tile).ToList()))
                    );

                // a new image constructed in an array!
                var newImage = new Tile[gridSize, gridSize];

                for (int row = 0; row < gridSize; row++)
                {
                    for (int col = 0; col < gridSize; col++)
                    {
                        Tile tileToAdd;
                        if (col == 0 && row == 0)
                        {
                            var corners = AllTiles.Where(tile => tile.IsCorner);
                            tileToAdd = corners.First();
                            while (!tileByEdges.ContainsKey(tileToAdd.GetEdgeString(Edge.Right)) || !tileByEdges.ContainsKey(tileToAdd.GetEdgeString(Edge.Bottom)))
                            {
                                tileToAdd.Rotate();
                            }
                        }
                        else if (row == 0)
                        {
                            var lastTile        = newImage[row, col - 1];
                            var edgeToConnectTo = lastTile.GetEdgeString(Edge.Right);
                            // get the tile by the edge that is not place
                            tileToAdd = tileByEdges[edgeToConnectTo].FirstOrDefault(tile => !tile.IsPlacedOnGrid);
                            while (tileToAdd.GetEdgeString(Edge.Left) != edgeToConnectTo && tileToAdd.GetEdgeString(Edge.LeftReverse) != edgeToConnectTo)
                            {
                                tileToAdd.Rotate();
                            }
                            // do we need to reverse?
                            if (tileToAdd.GetEdgeString(Edge.Left) != edgeToConnectTo)
                            {
                                tileToAdd.FlipHorizontal();
                            }
                        }
                        else
                        {
                            var lastTile        = newImage[row - 1, col];
                            var edgeToConnectTo = lastTile.GetEdgeString(Edge.Bottom);
                            // get the tile by the edge that is not place
                            tileToAdd = tileByEdges[edgeToConnectTo].FirstOrDefault(tile => !tile.IsPlacedOnGrid);
                            while (tileToAdd.GetEdgeString(Edge.Top) != edgeToConnectTo && tileToAdd.GetEdgeString(Edge.TopReverse) != edgeToConnectTo)
                            {
                                tileToAdd.Rotate();
                            }
                            // do we need to reverse?
                            if (tileToAdd.GetEdgeString(Edge.Top) != edgeToConnectTo)
                            {
                                tileToAdd.FlipVertical();
                            }
                        }

                        newImage[row, col]       = tileToAdd;
                        tileToAdd.IsPlacedOnGrid = true;
                    }
                }

                var newBigImage = new BigImage(newImage, gridSize);

                return(newBigImage);
            }