[Error Prompt] Cannot convert type 'System.Drawing.Image' to 'Byte[]'
If you have this problem or you can't make casting convert Image to Byte Array in dotNet Solution, you can follow bellow:
[Wrong Way] return (Byte[])imgLogoBuffer;
[Correct Way] Byte[] btImageLogo = new Byte[1];
[Correct Way] return btImageLogo = (Byte[])(new ImageConverter()).ConvertTo(imgLogoBuffer, btImageLogo.GetType());
بابا جان هر چی رو که نمی شه با cast کردن تبدیل کرد. راه حل بالا بد نیست. گرچه به عدد آدم های روی زمین (نه روی هوا) راه است برای رسیدن به بایت های تصویر یک Image (;




1 comments:
Imagine the power of tens of thousands of other web sites being able to easily
Post a Comment