我在pictureBox上显示图像对象时遇到问题。我有以下方法:
private async void scanButton_Click(object sender, EventArgs e)
{
var guid = await client.ScanRegionAsync(new Point(0, 0), new Size(200, 200));
var currentImage = new ImageData();
while (currentImage.TransmissionStatus != TransmissionStatus.ProcessStop)
{
currentImage = client.GetImage(guid);
if (currentImage.TransmissionStatus.Equals(TransmissionStatus.Image))
{
stitching.AttachImageToScene(currentImage.ImageBytes, currentImage.StartPoint);
}
}
pictureBox1.Image = stitching.CurrentImage;
stitching.CurrentImage.Save(@"c:\stitch.jpg", ImageFormat.Jpeg);
}
然而事情就是那张照片得到了保存,但是由于某种原因,pictureBox没有显示出来。 附:我尝试刷新/更新,试图克隆图像,试图使方法同步 - 相同的结果。