views:

66

answers:

1

I am devloping smart device application in C#. In this application I have some images in my application which I used to dispay on emulator from my application. To display the images on emulator I need to create the one folder of images which resides on the emulator. Only after that I am able to display the images in emulator. I am able to create the folder in emulator by using File->Configure->General->Shared Folder. For sharing the folder I am giving the path of the folder which contains the images. Once I share the folder the folder of images which resides in my application will get copied in emulator with the name "Storage Card". Now I need to use the path as Bitmap bmp=new Bitmap(@"/Storage Card/ImageName.jpg"); Now I am able to display the images in emulator. Can we display the images in the emulator without any image folder which resides on emultor (so that we dont need to place the image folder in emulator as in the above case by sharing the folder) ? If the answere is no then to run the application on different mobile devices we need to place the folder which contains the images on different mobile devices. Isnt it? If the answere is yes then how we can display the images on different mobile device from our application without placing any folder of images on mobile devices?

A: 

In order to display the images, you'll need to have the images on the device (or emulator) - otherwise it wouldn't have the data to know what to display.

There are a few ways you can get the images to the device or emulator. The easiest is if you add the images to your Visual Studio project and mark the image files as content that should be copied to the destination folder. Then Visual Studio will copy the image files along with the application file when you go to debug it, which is probably what you want. You'll need to change the path your application is looking for the files in (since they won't be in "/Storage Card" anymore).

To get the images on a target (non-emulator) device, you'll probably want to create a Visual Studio Install project, and have it include your exe and the image files (and specify which folder to put the images in when the app is installed).

The above is what I've done, and would recommend. But there are other options. One might be to download the images from the web, which might work for both an emulator and devices (but will require you to have the images available on the web, and the emulator and devices to be connected).

Andy Jacobs