public byte[] GetImage(Guid formId, Guid imageId, int height = 0, int width = 0) { var form = FormRepo.GetForm(formId); var finder = new ControlFinder(form); var image = finder.Find(imageId) as BizImage; if (image == null || image.ImageBytes == null) { return(null); } if (width <= 0 && height <= 0) { return(image.ImageBytes); } using (var ms = new MemoryStream(image.ImageBytes)) { using (var ms2 = new MemoryStream()) { ResizeImage(height, width, ms, ms2); ms2.Position = 0; return(ms2.ToArray()); } } }
/// <summary> /// Загружает любую форму по идентификатору /// </summary> /// <param name="formId">Идентификатор формы</param> /// <param name="languageId">Язык</param> /// <returns>Загруженная форма</returns> public BizForm GetAnyForm(Guid formId, int languageId = 0) { return(FormRepo.GetForm(formId, languageId)); }