open the image in windows photo viewer by clicking on picturebox1 c#

浪尽此生 提交于 2019-12-23 05:41:49

问题


I have a project with SQlite database . I save images in folder " pics " ( into debug folder) & their name in the database ( column "docpic") . When I click in a row , related image retrieve the image from database to picturebox1 . i want open the image ( in picturebox1 ) by windows photo viewer by clicking on picturebox1 . how can do this ?

i use this codes in picturebox1 click event but thats not work :

if (pictureBox1.Tag != null)
{
    System.Diagnostics.Process imageViewerProcess = new System.Diagnostics.Process();
    imageViewerProcess.StartInfo.CreateNoWindow = false;
    imageViewerProcess.StartInfo.FileName = "rundll32.exe";
    imageViewerProcess.StartInfo.Arguments =
            @"C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen "
                               + pictureBox1.Tag.ToString();
    imageViewerProcess.Start();
}

}

来源:https://stackoverflow.com/questions/42676443/open-the-image-in-windows-photo-viewer-by-clicking-on-picturebox1-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!