我是WPF应用程序的新手.我需要像这张图片一样自定义我的组合框.
我试过这个例子 http://www.eidias.com/Blog/2012/2/20/customizing-wpf-combo-box-style
<Window x:Class="win.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300" Background="Red">
<Window.Resources>
<ControlTemplate x:Key="CustomToggleButton" TargetType="ToggleButton">
<Grid>
<Border Name="Border" />
<Border Name="SmallBorder" />
<Path Name="Arrow" />
</Grid>
</ControlTemplate>
<Style TargetType="{x:Type ComboBoxItem}">
<Setter Property="FrameworkElement.OverridesDefaultStyle" Value="True" />
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ComboBoxItem}">
<Border>
<ContentPresenter />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type ComboBox}">
<Setter Property="FrameworkElement.OverridesDefaultStyle" Value="True" />
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBox">
<Grid>
<ToggleButton Template="{StaticResource CustomToggleButton}" />
<ContentPresenter />
<TextBox />
<Popup>
<Grid>
<Border>
<ScrollViewer>
<ItemsPresenter />
</ScrollViewer>
</Border>
</Grid>
</Popup>
</Grid> …Run Code Online (Sandbox Code Playgroud) 我有一个JSON文件,其中包含如下数据:
{"posts": [
{ "title":"1", "url":"n1.png" },
{ "title":"2", "url":"n2.png" },
{ "title":"3", "url":"n3.png" },
{ "title":"4", "url":"n4.png" },
{ "title":"5", "url":"n5.png" },
{ "title":"6", "url":"n6.png" },
{ "title":"7", "url":"n7.png" },
{ "title":"8", "url":"n8.png" },
{ "title":"9", "url":"n9.png" },
{ "title":"10", "url":"n10.png" },
]}
Run Code Online (Sandbox Code Playgroud)
我需要用两个文本框按范围过滤标题:从和到.
我正在开发一个从本地浏览和拍照的网络应用程序,我也希望通过相机捕获图像.我使用以下代码,我可以捕获设备相机.
<input type="file" capture="camera" accept="image/*" id="cameraInput" name="cameraInput">
Run Code Online (Sandbox Code Playgroud)
现在,我想获取图像和onchangeevent,转换为base64并希望在该页面中显示.
请帮助我们!
我在Photoshop中编辑了一个图像(颜色,亮度和其他一些东西).现在我想对其他一些图像应用相同的更改.如何自动完成此过程?
我已经按照这个小提琴示例Image到Base64.当我使用直接图像路径链接时它工作正常,但是当我通过相机图像时它失败了.
Camera.getPicture().then(function(imageURI) {
var imageUrl = "http://upload.wikimedia.org/wikipedia/commons/4/4a/Logo_2013_Google.png";
convertImgToDataURLviaCanvas(imageUrl, function(base64Img) {
alert(base64Img);
});
var result = convertImgToDataURLviaCanvas(imageURI);
}, function(err) {
alert(err);
}, {
quality: 75,
targetWidth: 320,
targetHeight: 320,
pictureSource: navigator.camera.PictureSourceType.PHOTOLIBRARY,
destinationType: navigator.camera.DestinationType.FILE_URI,
saveToPhotoAlbum: true
});
function convertImgToDataURLviaCanvas(url, callback, outputFormat) {
var img = new Image();
img.crossOrigin = 'Anonymous';
img.onload = function() {
var canvas = document.createElement('CANVAS');
var ctx = canvas.getContext('2d');
var dataURL;
canvas.height = this.height;
canvas.width = this.width;
ctx.drawImage(this, 0, 0);
dataURL = canvas.toDataURL(outputFormat);
alert(dataURL + "GANESH" + outputFormat);
callback(dataURL); …Run Code Online (Sandbox Code Playgroud)