Problem with InteropBitmap

Stimulsoft Reports.WPF discussion
Post Reply
skyrapper
Posts: 5
Joined: Fri Feb 18, 2011 8:38 am

Problem with InteropBitmap

Post by skyrapper »

Hello,

I am moving from Reports.net to Reports.Wpf but i have to keep backward compatibility.
This is why I have to use your function StiImageHelper.GetBitmapImageFromImage to convert a System.Drawing.Image to a BitmapSource.

This function returns an InteropBitmap which works as expected in the WPF userinterface. When I try to show this InteropBitmap in a Report nothing is displayed.

Because InteropBitmap is a BitmapSource, it should be possible to display the image in a report?
What am I doing wrong?

Kind regards,
Michael
Andrew
Posts: 4108
Joined: Fri Jun 09, 2006 3:58 am

Problem with InteropBitmap

Post by Andrew »

Hello,

We do not quite understand how do you use this method and, if possible, please send us an example. We have made an example in which it works perfectly, please see the attached file.

Thank you.
Attachments
831.WpfApplication1.zip
(14.33 KiB) Downloaded 291 times
skyrapper
Posts: 5
Joined: Fri Feb 18, 2011 8:38 am

Problem with InteropBitmap

Post by skyrapper »

Hello Andrew,

thanks for your answer!

It seems I can not up upload the modified sample project to this entry.
You will find the modified project which shows my problem here: *****

If you click the button the designer will open with a little report. If you click "preview" you will see, that the image in the datasource won't be displayed.

Please tell me what I have to do to show the image in a report,

Kinde regards,
Michael
Andrew
Posts: 4108
Joined: Fri Jun 09, 2006 3:58 am

Problem with InteropBitmap

Post by Andrew »

Hello,

We have slightly changed your Application.

Thank you.
Attachments
832.WpfApplication1.zip
(14.97 KiB) Downloaded 288 times
skyrapper
Posts: 5
Joined: Fri Feb 18, 2011 8:38 am

Problem with InteropBitmap

Post by skyrapper »

Hello Andrew,

thanks for your answer, but this solution is not possible for me.

This image to print will be provided by webservice as InteropBitmap. We can not change it to System.Drawing.Image.

The whole Application works with InteropBitmap since it derives from BitmapSource.
What can I do to display objects of type InteropBitmap in Stimulsoft.


Kind regards,
Michael
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Problem with InteropBitmap

Post by Alex K. »

Hello,

In BeforePrint event of image component you can use the following code:

Code: Select all

Image1.ObjectToDraw = logo.BitmapImage;
Gets or sets the WPF visual object that appeared as a result of the component rendering. This property accepts objects of two types: DrawingVisual and ImageSource.

Thank you.
Attachments
833.WpfApplication1.zip
(23.53 KiB) Downloaded 292 times
skyrapper
Posts: 5
Joined: Fri Feb 18, 2011 8:38 am

Problem with InteropBitmap

Post by skyrapper »

Hello Aleksey,

thanks for your help, now it works!

But it's not a nice solution since the designer of the report has to write code to display an image.
Can this be fixed in the future?

Kind regards,
Michael
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Problem with InteropBitmap

Post by Alex K. »

Hello Michael,

On the current moment, it remains to be this way, because it is very specific to the WPF technology. But our report engine supports compatibility with .NET, WPF, and Web.

Thank you.
Post Reply