Hack Forums
[.NET] IO.File.ReadAllBytes("C:\file.jpg") ?? In resource? - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] IO.File.ReadAllBytes("C:\file.jpg") ?? In resource? (/showthread.php?tid=4654905)



IO.File.ReadAllBytes("C:\file.jpg") ?? In resource? - legacyxo - Jan 25, 2015

Hey im wondering how i can do this while storing my .jpg file in resources so i can do
IO.File.ReadAllBytes("My.Resources.MyJPG")

but if i do this i get an error saying

Value of type 'System.Drawing.Bitmap' cannot be converted to '1-dimensional array of Byte'.


* - -SiR- - Jan 25, 2015

like this

Dim img As New System.Drawing.Bitmap(My.Resources.myJPG)