我有一个无边框,不可调整大小的WPF表单(WindowStyle = None,allowsTransparency = True,ResizeMode = NoResize),具有半透明背景.这是一张图片,显示了一个半透明的红色矩形,现在看起来如何,在记事本上运行:
然而,我希望背景模糊,就像Aero玻璃如何做到这一点,除了没有所有花哨的窗口边框和带条纹的彩色背景 - 我想自己处理.这是我希望它看起来像的模型:
我怎样才能以最有效的方式实现这一目标?
WinForms或WPF对我来说很好.希望它应该使用Aero玻璃使用的相同的东西(我很好用它只能启用Aero),而不是疯狂的东西,如捕获下面的屏幕区域作为位图和模糊.
这是我不想要的图片:
我知道这是可能的,我知道怎么做,但我不希望整个Aero玻璃窗口镀铬,或边框和标题栏,或窗口具有用户设置的Aero玻璃颜色,只是效果模糊窗口/窗体下面的任何东西.
我需要创建一个水平导航菜单,其中包含不断变化的项目数量(这很重要 - 我不能将宽度编码到CSS中,而且我不想用JS计算它们),它们填充到一定的宽度,让我们说800px.
有桌子,
<table width="800" cellspacing="0" cellpadding="0">
<tr>
<td>One</td>
<td>Two</td>
<td>Three</td>
<td>Four</td>
<td>Five Seven</td>
</tr>
</table>
<style>
table td {
padding: 5px 0;
margin: 0;
background: #fdd;
border: 1px solid #f00;
text-align: center;
}
</style>
Run Code Online (Sandbox Code Playgroud)
请注意,较长的项目会占用更多空间,我可以在不更改CSS中的任何内容的情况下将项目添加到HTML中,并且菜单项会缩小以容纳其他项目 - 整个菜单永远不会短于或长于800px.
由于菜单不是一个表的语义正确使用,这可以用列表和纯CSS来完成吗?
我正在使用Aloha编辑器在由PHP和MySQL支持的网站上编辑内容.它工作正常,但我需要能够插入图像/图片.我找到了一个Aloha编辑器插件.以下是一些链接:
第一个链接中有一个例子.但是,我无法在最新版本的Aloha编辑器和jQuery上运行该插件.它无法加载,Chrome说:
image.js:30 Uncaught TypeError: Cannot read property 'fn' of undefined
Run Code Online (Sandbox Code Playgroud)
我没有血腥的线索这意味着什么.
理想情况下,用户应该能够从服务器上的图像列表中选择图像.它们位于一个目录中,并且还有一个MySQL表.我怀疑这是存储库的用武之地,但我无法理解如何实现它.
有没有人在Aloha编辑器中使用这个插件有运气,或者找到任何其他插入图像的方法?
在我的共享便携式Xamarin项目中,这适用于UWP,Windows Phone 8.1和Windows 8.1:
HtmlWebViewSource htmlSource = new HtmlWebViewSource();
htmlSource.Html = @"<html><body><img src='ms-appx-web:///Assets/somePicture.png' /></body></html>";
htmlSource.BaseUrl = DependencyService.Get<IBaseUrl>().Get();
WebView webView = new WebView
{
Source = htmlSource,
};
Run Code Online (Sandbox Code Playgroud)
显然,这不是跨平台(iOS和Android).我想要这个,但它不适用于UWP,Windows Phone 8.1和Windows 8.1:
HtmlWebViewSource htmlSource = new HtmlWebViewSource();
htmlSource.Html = @"<html><body><img src='somePicture.png' /></body></html>";
htmlSource.BaseUrl = DependencyService.Get<IBaseUrl>().Get();
WebView webView = new WebView
{
Source = htmlSource,
};
Run Code Online (Sandbox Code Playgroud)
IBaseUrl:
public interface IBaseUrl { string Get(); }
Run Code Online (Sandbox Code Playgroud)
UWP,Windows Phone 8.1和Windows 8.1的BaseUrl实现,取自Windows Phone 8.0示例项目:
[assembly: Dependency(typeof(MyApp.UWP.BaseUrl))]
namespace MyApp.UWP
{
public class BaseUrl : IBaseUrl …
Run Code Online (Sandbox Code Playgroud) xamarin windows-phone-8.1 win-universal-app xamarin.forms windows-10-universal
假设您要阻止用户从您的Xamarin.Forms.WebView导航到外部页面.
public App ()
{
var webView = new WebView
{
Source = new HtmlWebViewSource
{
Html = "<h1>Hello world</h1><a href='http://example.com'>Can't escape!</a><iframe width='420' height='315' src='https://www.youtube.com/embed/oHg5SJYRHA0' frameborder='0' allowfullscreen></iframe>"
}
};
webView.Navigating += WebView_Navigating;
MainPage = new ContentPage {
Content = webView
};
}
private void WebView_Navigating(object sender, WebNavigatingEventArgs e)
{
// we don't want to navigate away from our page
// open it in a new page instead etc.
e.Cancel = true;
}
Run Code Online (Sandbox Code Playgroud)
这适用于Windows和Android.但在iOS上,它根本不加载!
在iOS上,即使从HtmlWebViewSource加载源代码时,也会引发Navigating事件,其URL看起来像 file:///Users/[user]/Library/Developer/CoreSimulator/Devices/[deviceID]/data/Containers/Bundle/Application/[appID]/[appName].app/
好吧,所以你可以用这样的东西解决这个问题:
private void WebView_Navigating(object sender, …
Run Code Online (Sandbox Code Playgroud) 我使用SoundManager2在我的网站上播放声音.
现在,我想在每次用户播放声音时发送Google Analytics事件.
SoundManager2的文档说你可以通过设置属性来捕捉"on play"事件但是当使用360-ui-player时,这不起作用.
我像这样初始化SoundManager2:
<link rel="stylesheet" type="text/css" href="/app/sm/360/360player.css" />
<link rel="stylesheet" type="text/css" href="/app/sm/flashblock.css" />
<script src="/app/sm/360/berniecode-animator.js" type="text/javascript"></script>
<script src="/app/sm/soundmanager2-nodebug-jsmin.js" type="text/javascript"></script>
<script src="/app/sm/360/360player.js" type="text/javascript"></script>
<script type="text/javascript">
soundManager.url = '/app/sm/swf/';
threeSixtyPlayer.config = {
playNext: false,
autoPlay: false,
allowMultiple: false,
loadRingColor: '#ccc',
playRingColor: '#AB3C2E',
backgroundRingColor: '#eee',
animDuration: 500,
onplay: function() {
alert('Playing!'); // DOES NOT WORK!
},
animTransition: Animator.tx.veryBouncy
}
</script>
Run Code Online (Sandbox Code Playgroud)
有没有人有这个工作的解决方案?
我读到了人们在SoundManager源代码中更改了createSound()函数的解决方案,但我希望看到一个解决方案而不更改库.
c# ×2
javascript ×2
xamarin ×2
aero ×1
aero-glass ×1
aloha-editor ×1
audio ×1
css ×1
html ×1
html-table ×1
ios ×1
jquery ×1
menu ×1
mysql ×1
navigation ×1
php ×1
webview ×1
winforms ×1
wpf ×1