Server
In the BCB 6 SP4 debugging pass, welcome prawns criticize correct.
OPENDIALOG1 Open JPEG image, Edit1 save image Address, Image1 display image//Other format image file is not tested, you can try.
Opendialog1->filename= ""; if (Opendialog1->execute ()) {edit1->text= opendialog1->filename; Image1->picture->loadfromfile (Edit1->text); }
Below: Save the image to the SQL Server database
if (! Edit1->text.isempty ()) {adoquery1->close (); Add Adoconnention on your own and configure Adoquery1->sql->clear (); Adoquery1->sql->add ("SELECT * from IMGs"); Adoquery1->open (); Adoquery1->insert ();
Adoquery1->fieldbyname ("imgaddress")->asstring=edit1->text; Adoquery1->fieldbyname ("Imgid")->asinteger=edit2->text.toint (); The number of the saved image Tblobfield *field=dynamic_cast<tblobfield *> (Adoquery1->fieldbyname ("img")); IMG is an image type of data field->loadfromfile (Edit1->text); Here is the key, to be directly transferred from the file. Do not tune Image1, so it is easy to "JEPG error #41" error
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.