locked
saving photo to local file after giving effects

    Question

  • i am planning to create a photo editor and edit images from pictures library using css 3 filters(like sepia,gray scale) ,how do i save this images permanently to my local folder (pictures)after giving effects?
    Thursday, January 03, 2013 12:37 PM

Answers

All replies

  • I'm not sure that CSS filters on images are preserved when saving.  However, you should try using the SVG image instead which takes a significantly more complex set of filters, and I am pretty sure when you extract the image programmatically, the filters stay.
    Thursday, January 03, 2013 6:56 PM
  • Hi,

    You can save photo to local pictures library with Windows.Storage.KnownFolders.picturesLibrary.createFileAsync().

    More details, please refer to my blog: http://blogs.msdn.com/b/win8devsupport/archive/2012/12/19/using-html5-javascript-in-windows-store-apps-data-access-and-storage-mechanism-ii.aspx .


    Roy
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Song Tian Wednesday, January 09, 2013 9:04 AM
    Friday, January 04, 2013 6:46 AM
  • Hi ,

    you can save  img file to app local folder with  "Windows.Storage.StorageFile.copyAsync"

    ex :

    var applicationData = Windows.Storage.ApplicationData.current;
    
    var localFolder = applicationData.localFolder;
    
    var picfile = Windows.Storage.StorageFile;
    
    var openPicker = new Windows.Storage.Pickers.FileOpenPicker();
            openPicker.viewMode = Windows.Storage.Pickers.PickerViewMode.thumbnail;
            openPicker.suggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.picturesLibrary;
            openPicker.fileTypeFilter.replaceAll([".png", ".jpg", ".jpeg"]);
    
            openPicker.pickSingleFileAsync().then(function (file) {
                if (file) {
                    picfile = file;
                } else {
                    picfile = null;
                }     
            });
    
    if (picfile !== null) {
                  
                    picfile.copyAsync(localFolder, "your img file name" + picfile.fileType)
                        .done();
                }



    軟體開發領域裡區區一個迷途工程師
    MyBlog: http://www.dotblogs.com.tw/ian/
    開發ASP.NET您要瞭解的基楚

    Friday, January 04, 2013 5:03 PM