首页 \ 问答 \ WPF UI线程状态(WPF UI Thread Status)

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
更新时间:2022-12-24 16:12

最满意答案

您可能会遇到意外行为,因为您的子节点已在组内移动。

当您在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);

http://plnkr.co/edit/TkTGAw0eGHF5flbVYLuQ?p=preview


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);

http://plnkr.co/edit/TkTGAw0eGHF5flbVYLuQ?p=preview

相关问答

更多
  • 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 ...
  • 查看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];
  • 您可能会遇到意外行为,因为您的子节点已在组内移动。 当您在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 ...
  • 我对我的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 ...
  • 那篇文章肯定缺乏描述。 我可以让你在那里的一部分; 也许有更多数学的人可以帮助完成。 根据这个答案 ,将非标准化的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)。 扭转这一点以获得新的坐标: ...
  • 您只能创建少于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) (可能你必须根据你的坐标系方向改 ...
  • 我没有测试它,但试试这个: 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--) { ...
  • 获取子节点相对于其父节点的position ,然后使用convertPoint:fromNode:或convertPoint:toNode:方法将父节点的坐标系转换为场景的坐标系。 (请记住, SKScene继承自SKNode并且是节点层次结构的根,因此您可以将其用于任何一种方法。)如果您需要在UIKit视图坐标空间中工作,请使用场景的convertPointToView:方法。 Get the child node's position with respect to its parent, then u ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。