brush

Brush pattern in c# wpf (xaml - vector)

孤人 提交于 2019-12-11 14:28:00
问题 I need to draw on canvas using a few brush patterns like "Paint" in Windows OS. I need "oil brush" and "pastel". As I understand, it's possible via VisualBrush.Visual (Canvas with vector paths). <UserControl x:Class="DrawingToolbar.DTBrushParamsContainer" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression

QBrush - scale a standard fill stipple pattern?

旧巷老猫 提交于 2019-12-11 03:14:31
问题 In PyQt, I have a QGraphicsScene to which I add a rectangle with one of the standard QBrush fill patterns, in this case Qt.Dense7Pattern. This shows up as expected when the scene is displayed at original 1:1 scale: the "dots" that make up the Dense7Pattern are some number of pixels apart from each other, let's say 5 pixels apart just to pick a number. Also, let's say the original rectangle is 50 pixels wide and 50 pixels tall. When I zoom in on that scene, let's say by a factor of 2, making

d3: brush changes click to mouseover

拟墨画扇 提交于 2019-12-11 01:18:52
问题 I'm trying to create a scatter plot with a combination of brush selection, tooltips and click events, but it seems that once I add a brush to an svg canvas, all click events on objects get mapped to mouseovers. Is there any way around this? Example code below and @ http://jsfiddle.net/7j8cr/ <script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> <script> var my_circles = [{"x": 40, "y": 100, "r": 12}, {"x": 100, "y": 40, "r": 8}], width = 400, height = 400, svg = d3.select("body

Disposing a static brush

你离开我真会死。 提交于 2019-12-10 21:37:56
问题 I'm writing a biorhythm app. To test it i have a form with a Button and a PictureBox. When I click on the button i do myPictureBox.Image = GetBiorhythm2(); Which runs ok for the first time, but on the second click it causes the following exception: System.ArgumentException: Parameter is not valid. at System.Drawing.Graphics.CheckErrorStatus at System.Drawing.Graphics.FillEllipse at Larifari.Biorhythm.Biorhythm.GetBiorhythm2 in c:\delo\Horoskop\Biorhythm.cs:line 157 at Larifari.test

Trying to animate a SolidColorBrush static resource

烂漫一生 提交于 2019-12-10 18:42:18
问题 What I'd like I want to reuse some styles across multiple UserControl types. I would like the background of some Border controls to flash, and I'd like them all to use the same style, static resource and animation, so that they all flash in sync. How I'm trying to do it To that end, I have defined some common colours in a resource dictionary, like so: <SolidColorBrush x:Key="StatusErrorBackground" Color="#440000" /> ...and I have also defined a StoryBoard in this dictionary, like so:

TextBlock brush giving incorrect color

北城余情 提交于 2019-12-10 13:39:33
问题 I have a TextBlock and a Rectangle, both sitting in an empty WPF4 window. The TextBlock's Foreground and the Rectangle's Fill are both set to a SolidColorBrush with value #80800000. This is what it looks like: The Rectangle's color is correct (a 50% transparent maroon) but the TextBlock gives a flat grey. What's going on? EDIT: Here's the XAML: <Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com

Repeat a background brush in WPF

让人想犯罪 __ 提交于 2019-12-10 04:01:57
问题 and thank you. This question is very similar to this old, unanswered question here: How to paint notebook-like lines as TextBox background? However, it is not the same - not exactly. I would like to create a notepad, lined paper-like background but I am not not familiar with how to repeat a brush in XAML. How do you? EDIT Here's the solution as part of a TextBox: <TextBox TextBlock.LineHeight="20" TextBlock.LineStackingStrategy="BlockLineHeight" Padding="20,10,20,20" TextWrapping="Wrap">

WPF 加载等待动画

梦想的初衷 提交于 2019-12-09 02:53:56
直接上代码: xmal: <Controls:MetroWindow x:Class="MyControlLibrarys.LoadDialog" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:MyControlLibrarys" Title="正在加载" WindowStyle="None" Height="180" Width="430" ShowMaxRestoreButton="False" ShowMinButton="False" ShowCloseButton="False" WindowStartupLocation="CenterScreen" Opacity="1"> <Grid> <Grid.ColumnDefinitions>

d3 using zoom and brush on a bar chart

…衆ロ難τιáo~ 提交于 2019-12-08 10:41:57
问题 Hi I am trying to adapt Matthew Izanuk's Unit Bar Chart with Brush and Zoom to a randomly generated bar chart I have already created. I get an error with the zoom function, on line 261 line 261 is x.domain(t.rescaleX(x2).domain()); Here is the code and jsFiddle <!DOCTYPE html> <body> <style> div { display: inline-block; vertical-align: top; } #bar_chart { border: 2px solid lightgray; border-radius: 15px; } #json { max-height: 600px; width: 200px; overflow: scroll; border: 2px solid gray;

R Shiny dataTableOutput not displaying Brushed Points

◇◆丶佛笑我妖孽 提交于 2019-12-08 09:48:21
问题 I'm developing an R Shiny dashboard using the Iris data in the ggplot2 dataset. It has three main components, a sidebar panel to select the variables to display in the plot, a ggplot with brushed points and a datatable below which shows the data of the brushed points. Everything works perfectly except the datatable does not seem to select the data points on the table. From what I can tell it has something to do with the line output$plot_brushed_points in the server. Any help would be greatly