私は.jpg画像をビットマップサムネイルに変換しました。私が今しようとしているのは、そのサムネイルをMS Access用のBLOBに変換することです。私は最近、私のコードはずさんかもしれので、コンピュータプログラミングを学び始めたが、している私のコードは今ある:サムネイルをMS Access用のBLOBに変換する
foreach (String files in Directory.GetFiles(dig.SelectedPath))
{
if (files.EndsWith(".JPG"))
{
//convert .jpg to thumbnail
Image image = new Bitmap(files);
Image pThumbnail = image.GetThumbnailImage(100, 100, null, new IntPtr());
//need code entered here to convert pThumbnail into a byte to be able to convert
//the thumbnail into blob
//To insert thumbnail into access if I can convert into blob
string cmdstr = "INSERT into IMGSTR(Path, Images) values(?, ?)";
OleDbCommand com = new OleDbCommand(cmdstr, vcon);
com.Parameters.AddWithValue("?", files);
com.Parameters.AddWithValue("?", pThumbnail);
com.ExecuteNonQuery();
image.Dispose();
}
}
をしてくださいあなたのタイトルに "C#Visual Express"などのプレフィックスを付けないでください。それがタグのためのものです。 –