Click here to Skip to main content
15,890,186 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
hi
I have assigned bit map object for the image using the coding given below..how to assign the bit map object for the image..help me

                                  CrystalDecisions.CrystalReports.Engine.PictureObject myPictureObjectOnReport;
myPictureObjectOnReport = (CrystalDecisions.CrystalReports.Engine.PictureObject)objRep.ReportDefinition.ReportObjects["pctCompanyImage"];
byte[] content = (byte[])dtAddress.Rows[0]["COMPANY_LOGO"];
MemoryStream stream = new MemoryStream(content);
Bitmap bitmap = new Bitmap(stream);


[edit]SHOUTING removed - OriginalGriff[/edit]
Posted
Updated 21-Apr-12 0:31am
v2
Comments
OriginalGriff 21-Apr-12 6:31am    
DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalisation if you want to be taken seriously.

1 solution

The question makes no sense. You cannot assign Bitmap to Image, because Bitmap is Image. Please see:
http://msdn.microsoft.com/en-us/library/system.drawing.bitmap.aspx[^].

From your last assignment statement of your code, you already got an image you need, constructed from a memory stream.

—SA
 
Share this answer
 
Comments
VJ Reddy 23-Apr-12 12:44pm    
Good point. 5!
Sergey Alexandrovich Kryukov 23-Apr-12 12:47pm    
Thank you, VJ.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900