vb.net - Saving a Image from PictureBox to a database -


I was thinking how to save a picture from my computer by using a dialog file to browse in the visual computer. Can i

I use the following code to select the form for my PC:

  private sub btnBuscar_Click (as the object, in the form of e EventArgs ) BtnBuscar.Click handles with OpenFileDialog1. CheckFileExists = true .ShowReadOnly = false .Filter = "All Files | * * | Bitmap Files (*) | * .bmp; ... * gif; * JPG" .philterIndex = 2 if .ShowDialog = DialogResult.OK then PictureBox1. Image = Image.FromFile (.FileName) from end to end End Sub   

With my form I am speaking to make any other class object:

  gestor.gregarMission (txtNombre.Text, txtTrip.Text, dtInicio.Value, numDuracionDia.Text, program, txtDatos.Text, txtResul.Text, diagram, txtNave.Text, cuerpo)   

I need to construct an object with some parameters including an image, it is constructor:

  public sub agregarMission (pnombre as string, ptripulantes as string, pfechaLanz as date , double as pduracion, pprograma as string , Pdescripcion as string, presultado as string, ** pinsignia as the image **, pnave as string, pcuerpo as string) New mission as dim objmision (Pinembre, PTRPulentes, Pfachalan, PDER , P.Program, PDScPCon, Probatada, Pininagia, Pineway, PCRPO) Multimage. Registrarmission (OBM) and all   

What I can not find is equal to the pictureBox.Image or wahetever so I can send it to the manufacturer.

Field type image in my SQL table, I have been told that the image type is actually an array, so I do not know that I can change it later in the string and it can be later added to the original type I can fix it as

If someone can give me a tip, I will be very grateful!

After "text" itemprop = "text">

you cross the image file name as a string in your agregarMission If you take it, you can use it to read the image, convert it to byte and put it in the PictureBox unless you use it for something else.

  Dim FIImage as fileInfo = New FileInfo (imageFilename) Dim FS FileStream = New FileStream (imageFilename, FileMode.Open, as FileAccess. Read, FileShare Reid) Dim IMGbitArray = New byte ( (Convert to INIT 32 (FII image lang)) - 1) {} F. Reed (IMGbATIre, 0, Convert.OINT32 (Fiimage. Lang)) Afs. Close   

Enter imgByteArray in your table field

Comments

Post a Comment

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -