redraw

WPF forcing redraw of canvas

蓝咒 提交于 2019-11-29 12:47:36
问题 Okay, in windows forms you can use .refresh() to cause a redraw event on an element. Is there a similar solution in WPF? An explanation of what I'm doing, I'm drawing a maze on a canvas object, and would like to watch as the maze is drawn (so I can see progress) instead of waiting 28 min for a solution to suddenly appear. I am drawing blocks on the canvas with a series of Rectangle s. Should the refresh be on the rectangle or the canvas? Here is a recent output: http://imgur.com/ftFOv I'd

html5 canvas redraw on resize

微笑、不失礼 提交于 2019-11-29 02:14:42
I have two canvas elements and need them to be resized on buttons click. <div class="sDetails"><div> <div id="canvasDiv" style="width: 310px;"><canvas id="canvasGraph"></canvas></div></div> <div class="kDetails"><div><div> <div id="canvasDiv" style="width: 310px; height: 240px;"><canvas id="canvasGraph"></canvas></div></div> and the script: var sketch;var sketch_sl;var onPaint;var canvas=null;var ctx=null;var tmp_ctx=null; function drawCanvas(div) { canvas = document.querySelector(div + " #canvasGraph"); ctx = canvas.getContext('2d'); sketch = document.querySelector(div + " #canvasDiv");

redrawing canvas html5 without flickering

拜拜、爱过 提交于 2019-11-28 08:14:11
问题 I've a screen being redraw every 25ms, and images are flickering, here is my code var FRAME_RATE = 40; var intervalTime = 1000/FRAME_RATE; gameLoop(); function gameLoop(){ context.clearRect(0, 0, 640, 640); renderMap(); window.setTimeout(gameLoop, intervalTime); } and here is renderMap() function function renderMap(){ var startX = playerX - (screenW / 2); var startY = playerY - (screenH / 2); maxX = playerX + (screenW / 2); maxY = playerY + (screenH / 2); $.getJSON('mapa3.json', function(json

Chrome does not redraw <div> after it is hidden

荒凉一梦 提交于 2019-11-27 22:43:46
I have some div s that show up on hover, and then are hidden. However, in Chrome (19.0.1084.56 m, Windows XP) when you unhover, Chrome doesn't redraw them as gone until you do something like scroll or resize the window. http://jsfiddle.net/y7NdR/3/ I am aware that certain modifications to my CSS will fix the problem, e.g. removing the position or z-index and overflow properties, but I really don't want to do that--the JSfiddle is paired down from a full site where I need them. Can anyone shed any light on exactly why this redraw problem is happening in Chrome? Does anyone have any tips to fix

Preventing Canvas Clear when Resizing Window

半腔热情 提交于 2019-11-27 20:33:48
I'm trying to create a simple app that draws rectangles within the Canvas tag. I've got the Canvas resizing to fullscreen, but whenever I resize the viewport, Canvas clears. I'm trying to prevent it from clearing and just keeping the content thats within it. Any ideas? http://mediajux.com/experiments/canvas/drawing/ Thanks! /* * This is the primary class used for the application * @author Alvin Crespo */ var app = (function(){ var domBod = document.body; var canvas = null; var canvasWidth = null; var canvasHeight = null; return { //Runs after the DOM has achieved an onreadystatechange of

html5 canvas redraw on resize

你。 提交于 2019-11-27 16:33:50
问题 I have two canvas elements and need them to be resized on buttons click. <div class="sDetails"><div> <div id="canvasDiv" style="width: 310px;"><canvas id="canvasGraph"></canvas></div></div> <div class="kDetails"><div><div> <div id="canvasDiv" style="width: 310px; height: 240px;"><canvas id="canvasGraph"></canvas></div></div> and the script: var sketch;var sketch_sl;var onPaint;var canvas=null;var ctx=null;var tmp_ctx=null; function drawCanvas(div) { canvas = document.querySelector(div + "

Difference between InvalidateRect and RedrawWindow

亡梦爱人 提交于 2019-11-27 11:29:18
问题 When I want to redraw a window, is there any preferred function to call between InvalidateRect and RedrawWindow? For instance, are these two calls equal: (win would be a HWND) RedrawWindow(win, NULL, NULL, RDW_INVALIDATE); InvalidateRect(win, NULL, NULL); The main question(s) : When should I use one or the other? Are there any differences that happen in the background? (different WM_messages / focus / order / priorities..) The reason that I want to redraw the window is because I send a new

Preventing Canvas Clear when Resizing Window

白昼怎懂夜的黑 提交于 2019-11-26 22:56:56
问题 I'm trying to create a simple app that draws rectangles within the Canvas tag. I've got the Canvas resizing to fullscreen, but whenever I resize the viewport, Canvas clears. I'm trying to prevent it from clearing and just keeping the content thats within it. Any ideas? http://mediajux.com/experiments/canvas/drawing/ Thanks! /* * This is the primary class used for the application * @author Alvin Crespo */ var app = (function(){ var domBod = document.body; var canvas = null; var canvasWidth =