WPF UI线程状态(WPF UI Thread Status)
我有一个wpf应用程序需要大约30秒来创建一个地图/图形。 我已经读过没有简单的方法可以绑定到UI呈现线程以获得进度更新。 所以我打算在一个值转换器上使用一个计数器来为我的地图着色,但这也是在UI线程上,所以我的问题是有没有人找到任何使用渲染线程的光滑方法呢?
谢谢。
I have a wpf application that takes ~30 seconds to create a map/graphic. I have read there is no easy way to tie into the UI rendering thread to get a progress update. So I was going to use a counter on a value converter which colors my map but that is also on the UI Thread, so my question is has anyone found any slick methods of working with the rendering thread yet?
Thanks.
原文:https://stackoverflow.com/questions/2318781
最满意答案
您可能会遇到意外行为,因为您的子节点已在组内移动。
当您在x = 120 y = 140时创建图像时。当您将组位置设置为(例如)x = 100 y = 100时,图像将被放置在x = 210(120 + 100)y = 240(140 + 100)。
只需减少子元素的位置:
yoda = new Konva.Image({ x: 5, y: 5, image: imageObj, width: 106, height: 118 }); group.add(border); group.add(yoda);
You may have unexpected behaviour because your children nodes are moved inside a group.
When you created the image in had x = 120 y = 140. When you set group position to (for example) x= 100 y = 100, image will be placed in x = 210 (120 + 100) y = 240 (140 + 100).
Just decrease positions of children elements:
yoda = new Konva.Image({ x: 5, y: 5, image: imageObj, width: 106, height: 118 }); group.add(border); group.add(yoda);
相关问答
更多-
Mac上的SceneAntialiasing.BALANCED了一个错误 ,它翻转了场景。 它是基于这个问题提交的,它已经针对Java 9修复,并且已经移植到最新版本的JDK 8。 解决方案是尽可能更新到最新的 JDK版本。 如果没有,删除抗锯齿参数或使用SceneAntialiasing.DISABLED也可以。 There was a bug with SceneAntialiasing.BALANCED on Mac that flipped the scene. It was filed based ...
-
从坐标获取位置?(Getting location from coordinates?)[2022-03-15]
查看Google地图的反向地理编码API 。 Check out Google Maps' Reverse Geocoding API. -
[self.view convertRect:button.frame fromView:button.superview]; [self.view convertRect:button.frame fromView:button.superview];
-
KonvaJS:小组关于儿童坐标的坐标(KonvaJS: Group's Coordinates With Respect to Childrens' Coordinates)[2023-06-19]
您可能会遇到意外行为,因为您的子节点已在组内移动。 当您在x = 120 y = 140时创建图像时。当您将组位置设置为(例如)x = 100 y = 100时,图像将被放置在x = 210(120 + 100)y = 240(140 + 100)。 只需减少子元素的位置: yoda = new Konva.Image({ x: 5, y: 5, image: imageObj, width: 106, height ... -
如何获得坐标(How to get coordinates)[2022-03-05]
我对我的webview演示进行了测试,如下所示: -(void)webViewDidFinishLoad:(UIWebView *)webView { [webView.scrollView setContentOffset:CGPointMake(0, 300)]; } 它运作良好。请粘贴一些代码进行深入分析 I make a test on my webview demo like this: -(void)webViewDidFinishLoad:(UIWebView *)webView { [w ... -
视口坐标的计算(Calcluation of viewport coordinates)[2023-01-08]
那篇文章肯定缺乏描述。 我可以让你在那里的一部分; 也许有更多数学的人可以帮助完成。 根据这个答案 ,将非标准化的coords转换为标准化的coords的公式是: (其中Cx / y =坐标X / Y; Sx / y =屏幕X / Y;以及Nx / y =标准化X / Y)。 将示例的数字插入: Nx = (350/1024) * 2 - 1 = -0.31640625 Ny = 1 - (210/768) * 2 = 0.453125 ......或(-.36,0.45)。 扭转这一点以获得新的坐标: ... -
坐标数组(Array of Coordinates)[2024-01-12]
您只能创建少于2^32 = 4.294.967.296条目的数组: new Array(4294967295) // works 但 new Array(4294967296) // RangeError: invalid array length 此行为在规范中定义: 每个Array对象都有一个length属性,其值始终是小于2 ^ 32的非负整数 You can only create arrays of less than 2^32 = 4.294.967.296 entries: new Arr ... -
旋转45度,垂直缩放0.5 这是仿射变换: 按旋转中心(xc,yc)坐标移动 回转 向后移动xc和一些yc(您可能需要另一个y-shift与屏幕边缘对齐)按y轴缩放 sq = Sqrt(2)/2 //Cos and Sin of 45 x_new = xc + (x_old - xc) * sq - (y_old - yc) * sq y_new = 0.5 * (yc + (x_old - xc) * sq + (y_old - yc) * sq) (可能你必须根据你的坐标系方向改 ...
-
GridLayout坐标(GridLayout coordinates)[2022-08-12]
我没有测试它,但试试这个: for (int y = s-1; y >= 0; y--) { for (int x = 0; x < v; x++) { grid[x][y] = new JLabel((x)+","+(y)); world.add(grid[x][y]); I didn't test it but try this out: for (int y = s-1; y >= 0; y--) { ... -
iOS spriteKit子节点相对于视图坐标的位置(iOS spriteKit child nodes position with respect to view coordinates)[2022-10-24]
获取子节点相对于其父节点的position ,然后使用convertPoint:fromNode:或convertPoint:toNode:方法将父节点的坐标系转换为场景的坐标系。 (请记住, SKScene继承自SKNode并且是节点层次结构的根,因此您可以将其用于任何一种方法。)如果您需要在UIKit视图坐标空间中工作,请使用场景的convertPointToView:方法。 Get the child node's position with respect to its parent, then u ...