Completed
Last Updated: 15 Nov 2023 11:44 by ADMIN
Release 2024 R1 PI1
Taki Xaftellis
Created on: 23 Oct 2023 13:40
Type: Bug Report
4
Processing.PictureBox.Image requires 'Telerik.Drawing.IImage' rather than 'System.Drawing.Image'

Previously, the Processing.PictureBox property Image required a System.Drawing.Image.

Starting with R3 2023 it requires Telerik.Drawing.IImage, and throws the exception:

Cannot implicitly convert type 'System.Drawing.Image' to 'Telerik.Drawing.IImage'. An explicit conversion exists (are you missing a cast?)

3 comments
Yoly
Posted on: 25 Oct 2023 15:11
Thank you Todor, I can confirm this workaround fixes the issue.
ADMIN
Todor
Posted on: 25 Oct 2023 08:27

Hi Yoly and Taki,

The recommended fix for the issue is to cast to the newly introduced Telerik.Drawing.ImageBase class. Here is a sample code:

private void PictureBox1_ItemDataBinding(object sender, System.EventArgs e)
{
	Processing.PictureBox pictureBox = (Processing.PictureBox)sender;
	System.Drawing.Image image = new System.Drawing.Bitmap(@"MyImagePath");

	pictureBox.Image = (Telerik.Drawing.ImageBase)image;

	//Avoid the following code as it may break with the later versions where we will fix the issue
	//pictureBox.Image = Telerik.Drawing.Contract.DrawingFactory.CreateImage(image);
}

Please, avoid the commented-out approach with Telerik.Drawing.Contract.DrawingFactory.CreateImage method as it may not work when we fix the issue.

Regards,
Todor
Progress Telerik

Stay tuned by visiting our roadmap and feedback portal pages, enjoy a smooth take-off with our Getting Started resources, or visit the free self-paced technical training at https://learn.telerik.com/.
Yoly
Posted on: 24 Oct 2023 22:48

I'm having the same issue. It broke my reports.

Is there any workaround for this?