绘图上下文中的WPF清除区域?(WPF Clear Region on a Drawing Context?)
所以我使用DrawingContext和DrawingVisual生成透明的PNG。
在DrawingContext中,我画了一个矩形。
我现在想在矩形内“切出”一个圆圈。 我该怎么做呢? 我没有在绘图上下文中找到任何清除区域的函数。
So I am producing a transparent PNG using a DrawingContext and DrawingVisual.
Inside the DrawingContext, I drew a rectange.
I would now like to "cut out" a circle inside of the rectangle. How do I do this? I did not find any functions in drawing context to clear a region.
原文:https://stackoverflow.com/questions/26559401
最满意答案
我认为你的主要潜在困惑是,当(例如)只有
A
被突出显示为红色时,你将这意味着“查询只返回来自A
数据”,但实际上它意味着“查询只返回那些数据A
有记录的情况 “。 该查询可能仍包含来自B的数据(对于B
没有记录的情况,查询将替换NULL
。)同样,下面的图片只包含了来自B圈的数据,那么为什么A包含在join语句中呢?
如果你的意思是 -
A
的图像完全是白色的,B
的部分有A
与A
不重叠的红色月牙形,那么:A
出现在查询中的原因是,A
是它的发现方式B
中的记录需要排除。 (如果A
没有出现在查询中,那么Venn图不会有A
,它只会显示B
,并且没有办法将期望的记录与不需要的记录区分开来。)这个图像看起来像是圆圈B是sql语句的主要焦点,但是从A开始(从A选择,加入B),sql语句本身给我传达了相反的印象,即A是焦点的sql语句。
完全正确。 出于这个原因,
RIGHT JOIN
是比较少见的; 虽然使用LEFT JOIN
的查询几乎总是可以重新排序以使用RIGHT JOIN
(反之亦然),但通常人们会使用LEFT JOIN
而不是RIGHT JOIN
来编写查询。I think your main underlying confusion is that when (for example) only
A
is highlighted in red, you're taking that to mean "the query only returns data fromA
", but in fact it means "the query only returns data for those cases whereA
has a record". The query might still contain data from B. (For cases whereB
does not have a record, the query will substituteNULL
.)Similarly, the image below that only includes data from the B circle, so why is A included at all in the join statement?
If you mean — the image where
A
is entirely in white, and there's a red crescent-shape for the part ofB
that doesn't overlap withA
, then: the reason thatA
appears in the query is,A
is how it finds the records inB
that need to be excluded. (IfA
didn't appear in the query, then Venn diagram wouldn't haveA
, it would only showB
, and there'd be no way to distinguish the desired records from the unwanted ones.)The image makes it seem like circle B is the primary focus of the sql statement, but the sql statement itself, by starting with A (select from A, join B), conveys the opposite impression to me, namely that A would be the focus of the sql statement.
Quite right. For this reason,
RIGHT JOIN
s are relatively uncommon; although a query that uses aLEFT JOIN
can nearly always be re-ordered to use aRIGHT JOIN
instead (and vice versa), usually people will write their queries withLEFT JOIN
and not withRIGHT JOIN
.
相关问答
更多-
sql连接为维恩图(sql joins as venn diagram)[2023-02-24]
我认为你的主要潜在困惑是,当(例如)只有A被突出显示为红色时,你将这意味着“查询只返回来自A数据”,但实际上它意味着“查询只返回那些数据A有记录的情况 “。 该查询可能仍包含来自B的数据(对于B没有记录的情况,查询将替换NULL 。) 同样,下面的图片只包含了来自B圈的数据,那么为什么A包含在join语句中呢? 如果你的意思是 - A的图像完全是白色的, B的部分有A与A不重叠的红色月牙形,那么: A出现在查询中的原因是, A是它的发现方式B中的记录需要排除。 (如果A没有出现在查询中,那么Venn图不会有 ... -
维恩图绘制算法(Venn Diagram Drawing Algorithms)[2022-01-22]
你在它们上有N个点和一个二元关系R,并且你需要用图形表示关系,以便每个节点都用欧几里得平面上的一个圆来表示,这样当且仅当对于相应的节点n和n'它有两个圆重叠认为n R n'。 You have N points and a binary relation R on them, and you need to represent the relation graphically so that every node is represented by a circle on Euclidean plane s ... -
另一个简单示例,显示如何使用VennDiagram包打印维恩图: library(VennDiagram) cardiome <- letters[1:10] superset <- letters[8:24] overlap <- calculate.overlap( x <- list("Cardiome"=cardiome, "SuperSet"=superset)) venn.plot <- draw.pairwise.venn( area1 = length(cardiome), ...
-
维恩图情节?(Venn diagram plot?)[2022-05-13]
有多种方法可以构建ViennDiagram。 一个是使用VennDiagram包: library(VennDiagram) grid.newpage() venn.plot <- draw.quad.venn( area1 = 1200, area2 = 420, area3 = 580, area4 = 650, n12 = 200, n13 = 100, n14 = 11, n23 = 20, n24 = 61, n34 = 0, n123 = 0, n ... -
让我们从一个可重复的例子开始: # Sample data (9 15-element subsets of the letters stored in a list) set.seed(144) (dfs <- replicate(9, sample(letters, 15), simplify=FALSE)) # [[1]] # [1] "b" "r" "y" "l" "g" "n" "a" "u" "z" "s" "j" "c" "h" "x" "m" # # [[2]] # [1] "b" " ...
-
如何绘制4套维恩图(How to plot venn diagram with 4 sets)[2022-12-17]
因此,在提供的应用程序中,您只是在固定图像上绘制文本,对吧? 并且您希望能够使用自己的颜色创建四组维恩图吗? 在这种情况下,你几乎可以使用任何服务器端脚本语言,即PHP或ASPX。 如果您的解决方案固定为四组(或更少),则适当放置椭圆应该是简单的数学运算。 ImageMagick应该在许多社区开发的编程语言中做到这一点。 So, in the provided app you are just painting text on top of a fixed image, right? And you wan ... -
改变后在Jupyter中绘制维恩图(matplotlib-venn)(Plotting Venn diagram in Jupyter after changes (matplotlib-venn))[2023-11-05]
如果使用fig=plt.figure()存储对图形实例的引用,则可以在将来的笔记本单元中访问该图形。 如果你不这样做,那么你将无法访问新单元格中的现有数字。 因此,在您设置标签后,您只需在之后再次写下fig再次显示该图。 这是一个工作示例: 单元格1: %matplotlib inline from matplotlib_venn import venn3 import matplotlib.pyplot as plt fig = plt.figure() set1 = set(['A', 'B', 'C' ... -
Matplotlib确实支持某种程度的事件处理以及绘图组件的“拾取”事件(无论是维恩图还是任何其他类型的图)。 从venn3函数返回的维恩图对象包含一个字段patches ,其中列出了构成该图的所有PathPatch对象。 你可以像任何其他Matplotlib补丁对象那样“挑选”它们: from matplotlib import pyplot as plt import numpy as np from matplotlib_venn import venn3 # Create the diagram ...
-
正如评论中已经讨论的那样,Vennerable使用网格图形并修复包函数内部的网格参数。 如果他们可以在他们的软件包中添加这种功能,你可能应该从软件包维护者那里请一下,但与此同时我会为你提供一个Hackof,它可以让你做你想做的事情: 第一个命令允许您编辑名为makevp.eqsc的函数,该函数似乎包含网格定义: trace("makevp.eqsc",edit=TRUE) 原始代码如下所示: function (xrange, yrange) { pushViewport(plotViewpo ...
-
require(VennDiagram) AA <- c("hi","foo", "bar","yep","woo","hoo") BB <- c("baa","yep", "woo","yes") CC <- c("yes","foo","hi","woo", "huh") x <- list(AA=AA , BB=BB , CC=CC) v0 <- venn.diagram( x, filename=NULL, fill = c("red", "blue ...