简体   繁体   English

访问WP7 Silverlight App项目上的图像

[英]Access to images on WP7 Silverlight App project

In my project in WP7 App / Silverlight I got some images that I would like to access on running WP7 app. 在WP7 App / Silverlight中的项目中,我获得了一些想要在运行WP7 App时访问的图像。 Is that possible? 那可能吗?

I mean - for example. 我的意思是-例如。

I am creating folder MyImages into my project. 我在我的项目中创建文件夹MyImages。 I put there few .png, example 1.png, 2.png etc. 我放了几个.png,例如1.png,2.png等。

I run application (compile etc) 我运行应用程序(编译等)

I am able to modify those files? 我可以修改那些文件? For example save something different to 例如,保存与

MyImages/1.png MyImages / 1.png

Some kind of overwrite this file? 某种覆盖此文件?

---------------------------- ADDED - - - - - - - - - - - - - - 添加

using (IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication())
            {
                if (myIsolatedStorage.FileExists(fileName))
                {
                    myIsolatedStorage.DeleteFile(fileName);
                }

                IsolatedStorageFileStream fileStream = myIsolatedStorage.CreateFile(fileName);
                BitmapImage bitmap = new BitmapImage();
                bitmap.SetSource(imageStream);

                WriteableBitmap wb = new WriteableBitmap(bitmap);
                wb.SaveJpeg(fileStream, wb.PixelWidth, wb.PixelHeight, 0, 85);

                MessageBox.Show(imageStream.ToString());

                fileStream.Close();
            }

是的,您可以在这里开始写一篇好文章

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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