首页 \ 问答 \ 绘图上下文中的WPF清除区域?(WPF Clear Region on a Drawing Context?)

绘图上下文中的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
更新时间:2022-01-03 14:01

最满意答案

我认为你的主要潜在困惑是,当(例如)只有A被突出显示为红色时,你将这意味着“查询只返回来自A数据”,但实际上它意味着“查询只返回那些数据A有记录的情况 “。 该查询可能仍包含来自B的数据(对于B没有记录的情况,查询将替换NULL 。)

同样,下面的图片只包含了来自B圈的数据,那么为什么A包含在join语句中呢?

如果你的意思是 - A的图像完全是白色的, B的部分有AA不重叠的红色月牙形,那么: 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 from A", but in fact it means "the query only returns data for those cases where A has a record". The query might still contain data from B. (For cases where B does not have a record, the query will substitute NULL.)

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 of B that doesn't overlap with A, then: the reason that A appears in the query is, A is how it finds the records in B that need to be excluded. (If A didn't appear in the query, then Venn diagram wouldn't have A, it would only show B, 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 JOINs are relatively uncommon; although a query that uses a LEFT JOIN can nearly always be re-ordered to use a RIGHT JOIN instead (and vice versa), usually people will write their queries with LEFT JOIN and not with RIGHT JOIN.

相关问答

更多
  • 我认为你的主要潜在困惑是,当(例如)只有A被突出显示为红色时,你将这意味着“查询只返回来自A数据”,但实际上它意味着“查询只返回那些数据A有记录的情况 “。 该查询可能仍包含来自B的数据(对于B没有记录的情况,查询将替换NULL 。) 同样,下面的图片只包含了来自B圈的数据,那么为什么A包含在join语句中呢? 如果你的意思是 - A的图像完全是白色的, B的部分有A与A不重叠的红色月牙形,那么: A出现在查询中的原因是, A是它的发现方式B中的记录需要排除。 (如果A没有出现在查询中,那么Venn图不会有 ...
  • 你在它们上有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), ...
  • 有多种方法可以构建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" " ...
  • 因此,在提供的应用程序中,您只是在固定图像上绘制文本,对吧? 并且您希望能够使用自己的颜色创建四组维恩图吗? 在这种情况下,你几乎可以使用任何服务器端脚本语言,即PHP或ASPX。 如果您的解决方案固定为四组(或更少),则适当放置椭圆应该是简单的数学运算。 ImageMagick应该在许多社区开发的编程语言中做到这一点。 So, in the provided app you are just painting text on top of a fixed image, right? And you wan ...
  • 如果使用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 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)