Let's say if I capture a screen shot. There is my code for it
int sWidth = 1600, sHeight = 1200;
Bitmap B_M_P = Bitmap(sWidth, sHeight);
Graphics gfx = Graphics.FromImage((Image)B_M_P);
gfx.CopyFromScreen(0, 0, 0, 0, new Size(screenWidth, screenHeight));
B_M_P.Save("img.jpg", ImageFormat.Jpeg);
instead of saving this to an Image, i wanna be able to send this to my SQL or MySQL and store them in the database as BLOB.
i know the LINQ
as well to query the DB. What i don't know is the intermediate portion.
- What kind of
Data Type
will be used to INSERT in a BLOB column, my guess is it will be aByte[]
?
if it is a 'Byte', then the conversion is pretty easy.
ImageConverter imgc = new ImageConverter();
Byte[] temp = (byte[])imgc.ConvertTo(B_M_P,typeof(byte[]));
so that afterwards i can prepare my query
"INSERT INTO EMPLOYEE (pic) VALUES ('"+temp+"');"
- If not then WHAT IS THE TYPE & HOW TO CONVERT