使用 HTML Windows phone 中的内容创建 WriteableBitmap 8.1
Create WriteableBitmap using HTML content in Windows phone 8.1
Create WriteableBitmap using HTML content in Windows phone 8.1 不涉及 XAML
我在 C# 中创建了 WebView 对象并在 WebView.NaviagateToString 中呈现 HTML 内容,并尝试使用 WebView.CapturePreviewToStreamAsync 方法获取对象,但我收到全局异常(值不在预期范围内)。
WebView wv = new WebView();
wv.NavigateToString(HTML Content);
InMemoryRandomAccessStream imras = new InMemoryRandomAccessStream();
await wv.CapturePreviewToStreamAsync(imras);
我也尝试使用下面的代码,但我没有找到 dll。
Bitmap m_Bitmap = new Bitmap(400, 600);
PointF point = new PointF(0, 0);
SizeF maxSize = new System.Drawing.SizeF(500, 500);
HtmlRenderer.HtmlRender.Render(Graphics.FromImage(m_Bitmap),"<html><body><p>This is a shitty html code</p><p>This is another html line</p></body>", point,maxSize);
m_Bitmap.Save(@"C:\Test.bmp")
请帮我解决这个问题。
谢谢。
目前不可能,Windows Phone 应用商店应用确实有 phone-only ScreenCapture API,但它仍然需要在您的应用中显示您的内容。
我们正在努力更好地了解客户对社会支持体验的看法,因此如果您有时间,我们将不胜感激您参与本次访谈项目。感谢您帮助使社区论坛成为一个好地方。
Create WriteableBitmap using HTML content in Windows phone 8.1 不涉及 XAML
我在 C# 中创建了 WebView 对象并在 WebView.NaviagateToString 中呈现 HTML 内容,并尝试使用 WebView.CapturePreviewToStreamAsync 方法获取对象,但我收到全局异常(值不在预期范围内)。
WebView wv = new WebView();
wv.NavigateToString(HTML Content);
InMemoryRandomAccessStream imras = new InMemoryRandomAccessStream();
await wv.CapturePreviewToStreamAsync(imras);
我也尝试使用下面的代码,但我没有找到 dll。
Bitmap m_Bitmap = new Bitmap(400, 600);
PointF point = new PointF(0, 0);
SizeF maxSize = new System.Drawing.SizeF(500, 500);
HtmlRenderer.HtmlRender.Render(Graphics.FromImage(m_Bitmap),"<html><body><p>This is a shitty html code</p><p>This is another html line</p></body>", point,maxSize);
m_Bitmap.Save(@"C:\Test.bmp")
请帮我解决这个问题。
谢谢。
目前不可能,Windows Phone 应用商店应用确实有 phone-only ScreenCapture API,但它仍然需要在您的应用中显示您的内容。
我们正在努力更好地了解客户对社会支持体验的看法,因此如果您有时间,我们将不胜感激您参与本次访谈项目。感谢您帮助使社区论坛成为一个好地方。