当图像名称中有空格时,在共享html内容时无法显示缩略图 [英] unable display a thumbnail while sharing html content when image has a space in its name
问题描述
我正在尝试实现共享合同,我在尝试共享HTML内容,其中有一个动态附加源的图像标记。当
图像名称中没有空格时,图像会很好地显示。当图像名称中有空格时,不会显示图像。
以下是我正在使用的代码
String ^ htmlFormat = HtmlFormatHelper :: CreateHtmlFormat("< table cellpadding ="" 7"">< tr>< td>< img src = \"" + serviceItemPath + QUOT; \" />< / TD>< TD>" + m_pTargetServiceItem->名称+ QUOT;<峰; br />< a取代;" + m_ShareCharmUri-> DisplayUri + QUOT;< / A>< / TD>< / TR>< /表>");
RandomAccessStreamReference ^ streamRef =
RandomAccessStreamReference :: CreateFromUri(ref new Uri(serviceItemPath));
m_dShareCharmDataPackage-> ResourceMap-> Insert(serviceItemPath,streamRef);
m_dShareCharmDataPackage-> SetHtmlFormat(htmlFormat);
你想构建一个Share Target项目还是Share Source Project。
但是这两个项目中的HTML内容都应该显示在WebView控件中。
请检查共享内容目标应用示例
http://code.msdn.microsoft.com/windowsapps/Sharing-Content-Target-App-e2689782
最好的问候,
Jesse
I am trying to implement the share contract where in I am trying to share HTML content in which there is an image tag for which the source is appended dynamically. The image is displayed well when there is no space in
the image name. The image is not displayed when there is a space in the name of the image.
Below is the code I am using
String^ htmlFormat = HtmlFormatHelper::CreateHtmlFormat("<table cellpadding=""7""><tr><td><img src=\""+serviceItemPath+"\"/></td><td>"+m_pTargetServiceItem->Name+"<br/><a>"+m_ShareCharmUri->DisplayUri+"</a></td></tr></table>"); RandomAccessStreamReference^ streamRef = RandomAccessStreamReference::CreateFromUri(ref new Uri(serviceItemPath)); m_dShareCharmDataPackage->ResourceMap->Insert(serviceItemPath,streamRef); m_dShareCharmDataPackage->SetHtmlFormat(htmlFormat);
Hi,
Do you want to build a Share Target project or Share Source Project.
But Both of these project, the HTML content should be shown in the WebView control.
Please check Sharing content target app sample
http://code.msdn.microsoft.com/windowsapps/Sharing-Content-Target-App-e2689782Best regards,
Jesse
这篇关于当图像名称中有空格时,在共享html内容时无法显示缩略图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!