Ejemplo n.º 1
0
        public static void MediaAddSpotted(string mediaId, string userId, MediaSpottedRectangle rectangle, HyvesServicesCallback<bool> serviceCallback)
        {
            Dictionary<string, string> parameters = new Dictionary<string, string>();

            parameters["mediaid"] = mediaId;
            parameters["target_userid"] = userId;
            parameters["rectangle"] = string.Format("{0},{1},{2},{3}", rectangle.x, rectangle.y, rectangle.width, rectangle.height);
            Request<bool>(HyvesMethod.MediaAddSpotted, parameters, serviceCallback, new RequestCallbackDelegate<bool>(MediaAddSpottedReponseCallback));
        }
Ejemplo n.º 2
0
 private void btnSpot_Click(object sender, EventArgs e)
 {
     for( int index = 0; index < flpFaces.Controls.Count;)
     {
         FaceOverlay face = (FaceOverlay)flpFaces.Controls[index];
         if (face.User.userid != String.Empty)
         {
             MediaSpottedRectangle rectangle = new MediaSpottedRectangle();
             rectangle.x = (65535 / face.Media.image.width) * ((MCvAvgComp)face.Tag).rect.Left;
             rectangle.y = (65535 / face.Media.image.height) * ((MCvAvgComp)face.Tag).rect.Top;
             rectangle.width = (65535 / face.Media.image.width) * ((MCvAvgComp)face.Tag).rect.Width;
             rectangle.height = (65535 / face.Media.image.height) * ((MCvAvgComp)face.Tag).rect.Height;
             MediaService.MediaAddSpotted(face.Media.mediaid, face.User.userid, rectangle, (HyvesServicesCallback<bool>) delegate(ServiceResult<bool> serviceResult){
                 this.BeginInvoke( new HyvesServicesCallback<bool>(SpottedAdded),serviceResult);
             });
             flpFaces.Controls.Remove(face);
         }
         else
         {
             index++;
         }
     }
 }