【问题标题】:windows phone 8 sharing an image along with a prepopulated textwindows phone 8 共享图像以及预填充的文本
【发布时间】:2014-08-23 21:02:40
【问题描述】:

我用 c# 为 windows phone 8 创建了一个应用程序。 当按下按钮时,我截取屏幕截图并与社交网络共享,我想在状态文本框中与图像共享预填充的文本,但是当我尝试使用下面的代码时它只共享图像,我在做什么错了吗?

private void Share_Click(object sender, RoutedEventArgs e)
    {
        var bmp = new WriteableBitmap(this.theGraph1, null);
        var width = (int)bmp.PixelWidth;
        var height = (int)bmp.PixelHeight;
        using (var ms = new MemoryStream(width * height * 4))
        {
            bmp.SaveJpeg(ms, width, height, 0, 100);
            ms.Seek(0, SeekOrigin.Begin);
            var lib = new MediaLibrary();
            var picture = lib.SavePicture(string.Format("test.jpg"), ms);
            var text = new ShareStatusTask();
            var task = new ShareMediaTask();
            text.Status = AppResources.ShareThought;
            task.FilePath = picture.GetPath();
            task.Show();
            text.Show();
        }
    }

【问题讨论】:

    标签: c# windows-phone-8 social-networking


    【解决方案1】:

    您不能将 ShareStatusTask 和 ShareMediaTask 组合成一个共享“操作”。在 WP8 中无法使用标准方式共享文本+图像,但您可以在 WP8.1 中进行共享,看看http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh871374.aspx

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-15
      • 1970-01-01
      • 1970-01-01
      • 2016-07-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多