Current filter:
                                You should refresh the page.
                                  • Hello,
                                    I would like to ask you how to load an image from byte array into ImageEdit.

                                    Thank you
                                    Ales Kodys

                                1 Solution

                                Creation Date Importance Sort by

                                To load the image to ImageEdit from the bytes array, convert your bytes array to a BitmapImage and set the result as the ImageEdit.EditValue property value:

                                static BitmapImage BytesToImage(byte[] imageData) { if (imageData == null || imageData.Length == 0) return null; var image = new BitmapImage(); using (var mem = new MemoryStream(imageData)) { mem.Position = 0; image.BeginInit(); image.CreateOptions = BitmapCreateOptions.PreservePixelFormat; image.CacheOption = BitmapCacheOption.OnLoad; image.UriSource = null; image.StreamSource = mem; image.EndInit(); } image.Freeze(); return image; } private void OnSetImageButtonClick(object sender, RoutedEventArgs e) { imageEdit.EditValue = BytesToImage(imageBytes); }
                                • ALK 06.17.2013

                                  It works fine. Thank you!!

                                • Alexander S (DevExpress Support) 06.17.2013

                                  You are welcome. If you need further assistance, please do not hesitate to contact us.