이 코드는 어떻게 이미지를 변환합니까? 어떻게 bin 폴더에있는 폴더의 이미지를 정의 할 수 있습니까? "ch/1.jpg" 어느 누구도이 문제를 해결할 수 있습니까? 당신은 변환하는 과정을 통해 갈 필요가 없습니다이 암호화 코드를 사용하여 이미지 링크를 양식에 추가하는 방법은 무엇입니까?
Image img = Image.FromFile("C:\mypath\myimage.png"); //load the file as image
pictureBox1.Image = img; //use the image how you like
: 파일에서 이미지를로드하려면 난 그냥 사용, 20 사진 20 개 형태 ...
private static byte[] ConvertImageToByteArray(System.Drawing.Image imageToConvert,
ImageFormat formatOfImage)
{
byte[] Ret;
try
{
using (MemoryStream ms = new MemoryStream())
{
imageToConvert.Save(ms,formatOfImage);
Ret = ms.ToArray();
}
}
catch (Exception) { throw;}
return Ret;
}
//When you are ready to convert the byte array back
//to an image, you can include the following code
//in your method.
System.Drawing.Image newImage;
using (MemoryStream ms = new MemoryStream(myByteArray,0,myByteArray.Length))
{
ms.Write(myByteArray,0,myByteArray.Length);
newImage = Image.FromStream(ms,true);
// work with image here.
// You'll need to keep the MemoryStream open for
// as long as you want to work with your new image.
}
죄송 합니다만 질문을 전혀 이해하지 못했습니다 .. 어떤 질문이 ... –
이 질문에 대한 답변을 찾을 수 없습니다. 어떻게 이미지를 추가 할 수 있습니까? 어떻게 이미지를 형식으로 표시 할 수 있습니까? – BuschJoe