Page 1 of 1
Problem with InteropBitmap
Posted: Fri Feb 18, 2011 9:02 am
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
Problem with InteropBitmap
Posted: Mon Feb 21, 2011 12:57 am
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.
Problem with InteropBitmap
Posted: Mon Feb 21, 2011 3:22 am
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
Problem with InteropBitmap
Posted: Mon Feb 21, 2011 5:30 am
by Andrew
Hello,
We have slightly changed your Application.
Thank you.
Problem with InteropBitmap
Posted: Mon Feb 21, 2011 7:10 am
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
Problem with InteropBitmap
Posted: Mon Feb 21, 2011 7:57 am
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.
Problem with InteropBitmap
Posted: Tue Feb 22, 2011 3:38 am
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
Problem with InteropBitmap
Posted: Tue Feb 22, 2011 6:19 am
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.