简体   繁体   中英

How to open a picture in the viewer used by the content manager in windows mobile 6.5 using C#?

I'm currently designing a windows mobile application using compact framework 3.5 and I need to be able to display pictures taken by the user for paths that I have previously stored.

At the moment all I did was to create a new form dialog, that loads the picture into a PictureBox like this:

public formPictureViewer(string fileName)
{
    InitializeComponent();
    pictureBox.Image = new Bitmap(fileName);
}

The above approach is very simple, but it has the disadvantage that it does not allow the user to zoom in the image or to view it in full screen, unless all these features are programmed in to the form. What I would like is to simply call or execute the picture in the same dialog/viewer that opens up when clicking a .jpg file in the content manager/file manager of the smartphone. Probably this is the default viewer associated with the file in windows mobile, and it does have funcions for zooming in, full screen mode, setting as wallpaper, etc.

Maybe it's a very simple thing like calling something similar to ShellExecute... I'ts just that I'm new to the compact framework/windows mobile development and don't know all the tricks yet...

You can use the System.Diagnostics namespace to call the built in picture/image viewer (pimg.exe)

        ProcessStartInfo psi = new ProcessStartInfo();
        psi.FileName = @"\Windows\pimg.exe";
        psi.Arguments = @"\My Documents\My Pictures\Flower.jpg";

        Process.Start(psi);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM