We are planning to use the WPf RadImage in order to preview, maybe retouch, save and print images.
Then I have two questions :
Can we import base64 string images in RadImageEditor ?
Is there a way to print from the RadImageEditor ?
Thanks for your help
Julien
1 Answer, 1 is accepted
0
Dilyan Traykov
Telerik team
answered on 15 Apr 2022, 08:26 AM
Hello Julien,
Indeed, you can import a base64 string as an image to the RadImageEditor control in a similar manner:
byte[] binaryData = Convert.FromBase64String(base64string);
imageEditorUI.Image = new Telerik.Windows.Media.Imaging.RadBitmap(new MemoryStream(binaryData));
As for the printing, currently, the RadImageEditor control does not provide an API for printing its images, but we do have an open feature request for which you can vote: ImageEditor: Add printing support.
With that said, you could still achieve the desired result, for example, by subscribing to the Click event of a button. In it, you could create a new PrintDialog class, as well as utilize the RadBitmap class, to prepare the image for printing, and finally, call the PrintVisual method of the created print dialog instance. The following code snippet shows this approach implemented:
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.