如何将图表的图像从Silverlight应用程序复制到剪贴板? [英] How to copy image of a chart from Silverlight application to clipboard?

查看:205
本文介绍了如何将图表的图像从Silverlight应用程序复制到剪贴板?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Silverlight 3.0应用程序与一些自定义图形和一些图表。我需要找到最好的方式将这些图形转换为PowerPoint演示文稿。

I have a Silverlight 3.0 applications with some custom graphics and some charts. I need to find the best way to transfer these graphics to a PowerPoint presentation.

我看过Silverlight 4.0提供剪贴板API,但只支援Unicode文字,而不支援图片。

I've read that Silverlight 4.0 offers a Clipboard API, but there is only support for Unicode-text, not images.

有没有办法实现这个任务,而不强迫用户手动 PrtSc ,然后粘贴到其他应用程序?

Is there a way to achieve this task without forcing users to manually PrtSc and than paste to other applicatons?

推荐答案

在SL3中没有简单的方法。我的建议是使用WriteableBitmap并保存到IsolatedStorage,然后提示用户使用FileSave对话框保存到他们的框(然后他们必须把它放在PowerPoint中)。在SL3中对话框的唯一问题是它不允许你设置扩展类型,所以他们需要输入PNG或JPG扩展。这和 PrtSc Ctrl + P 都需要多步骤的用户操作,这总是一个失败点。

There's no simple way to do this in SL3. My recommendation would be to use a WriteableBitmap and save that to IsolatedStorage and then prompt the user with a FileSave Dialog to save to their box (and then they would have to put it in PowerPoint). The only problem with that Dialog in SL3 is that it doesn't allow you to set the extention type so they would need to type in the PNG or JPG extention. Both this and the PrtSc, Ctrl+P require multi-step user action and that is always a point of failure.

在SL4中有更多的选择 - 你甚至不需要在SLOOB中的剪贴板。您只需使用AutomationFactory自动执行PowerPoint。

In SL4 there are more choices - you don't even need the Clipboard in an SLOOB. You can just use AutomationFactory to automate PowerPoint.

这篇关于如何将图表的图像从Silverlight应用程序复制到剪贴板?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆