private MicroLayout GetCameraImage(int Index)
        {
            Bitmap        Bmp;
            ImageConstant v;
            DateTime      TP;
            string        Id;

            lock (images)
            {
                Bmp = images [Index];
                TP  = imageTP [Index];
            }

            if (Bmp == null)
            {
                return(new MicroLayout(new Rows(
                                           new Row(1, HorizontalAlignment.Center, VerticalAlignment.Center, new Label("N/A")))));
            }
            else
            {
                Id = typeof(CamStorage).FullName + ".Cam." + TP.Year.ToString("D4") + TP.Month.ToString("D2") + TP.Day.ToString("D2") +
                     TP.Hour.ToString("D2") + TP.Minute.ToString("D2") + TP.Second.ToString("D2");
                v            = new ImageConstant(Id, Bmp);
                v.ScaleToFit = true;

                return(new MicroLayout(new Rows(
                                           new Row(1, HorizontalAlignment.Center, VerticalAlignment.Center, new Label(TP.ToShortDateString() + ", " + TP.ToLongTimeString())),
                                           new Row(4, HorizontalAlignment.Center, VerticalAlignment.Center, v))));
            }
        }
Esempio n. 2
0
 public Image GetImage(ImageConstant constant)
 {
     try
     {
         return(_imageDal.GetList(s => s.Constant == constant && s.WebSiteId == _globalVariable.WebSiteId)[0]);
     }
     catch (Exception e)
     {
         return(null);
     }
 }
        public string GetImageTagProperty(ImageConstant imageConstant)
        {
            Image image = _imageService.GetImage(imageConstant);

            return(ConvertImageTagProperty(image));
        }