double-buffering

WS_EX_COMPOSITED - high CPU

自闭症网瘾萝莉.ら 提交于 2019-12-11 04:36:42
问题 I am using WS_EX_COMPOSITED style in my application but its running the CPU to 100%, is there way to stop my application drawing for a while and to resume only when i need ? Some people are suggesting to use Sleep's but where exactly in WndProc do i put sleeps ? Thanks in advance. 回答1: Don't use Sleep . It is the solution to almost no problems. It's true that WS_EX_COMPOSITED can hog CPU but mostly on XP in my experience. There is a much less significant performance hit on Vista and up.

How to draw an Image underneath an open Menu

时光怂恿深爱的人放手 提交于 2019-12-11 00:41:32
问题 I'm implementing my own double-buffering for a BufferedImage in a JPanel so that I can display the mouse location in the BufferedImage without repainting every object back onto it on mousemovement. When a JMenu in the parent JFrame is open, the BufferedImage gets repainted on top of the JMenu. This class is not complete, and has only the necessary methods, public class Foo extends JPanel implements ComponentListener { BufferedImage bufferedImage; long mousePosX; long mousePoxY; protected void

Optimize drawing for paint application c#

江枫思渺然 提交于 2019-12-06 16:49:18
I am making a paint project like photoshop using c#. I have used GDI+ for the drawing. Sadly I cannot post the screen shot cuz of the reputation points required. EDIT : Ok i got enough rep to upload a pic. My drawing using the mouse lags when the brush size increases. I have a canvasBuffer which is drawn to the canvas panel protected override void OnPaint(PaintEventArgs e) { if (canvasBuffer != null) { using (Graphics g = e.Graphics) { g.DrawImage(canvasBuffer, e.ClipRectangle, e.ClipRectangle, GraphicsUnit.Pixel); } } } And this is what happens when any painting is done. I store the list of

HTML canvas double buffering frame-rate issues

南笙酒味 提交于 2019-12-06 12:08:59
I have a full-screen canvas with 3 images drawn on it. When I resize the window, these images change position; however, it appears to be very glitchy, more so in Firefox. I've been reading that double-buffering should resolve this issue, but I'm wondering how I would double buffer when the next position is unknown. That is to say, I cannot determine what should be buffered in the future, so how would this be possible? Here is one source that seems doable, but I do not fully understand the concept Fedor is trying to explain. Does HTML5/Canvas Support Double Buffering? So far I have, $canvas = $

JavaFX Canvas Double Buffering

早过忘川 提交于 2019-12-06 11:23:36
I am replicating a classic game, Pong, in Java using JavaFX. I am using java.util.Timer, java.util.TimerTask for the game loop and JavaFX's Canvas for rendering. Is there a way to add double buffering to the Canvas so the animation doesn't flicker? Or should I approach this differently? Bellow is the code. I removed some parts of it, that I think are irrelevant, since the code is around 200 lines long. Canvas canvas = new Canvas(stageW, stageH); GraphicsContext gc; public void start(Stage stage) throws Exception { Group root = new Group(); gc = canvas.getGraphicsContext2D(); Timer loop = new

WinAPI Double-buffering

落花浮王杯 提交于 2019-12-04 13:42:29
问题 A default winAPI application does not have double-buffering. Instead, it does a very, very good job of ensuring that only what needs to be drawn is drawn, and that gives it a seamless appearance. However, when you resize the window, the entire thing needs to be redrawn, and this causes flickering between the controls, the background on the tab, and sometimes the white of the tab. So my question is, what is the easiest way to support double buffering in my application? 回答1: Create a bitmap the

Is it possible to eliminate flickering entirely when resizing a window?

為{幸葍}努か 提交于 2019-12-03 17:43:58
问题 Normally, even when using double buffering, when resizing a window, it seems that it's inevitable that the flickering will happen. Step 1, the original window. Step 2, the window is resized, but the extra area hasn't been painted. Step 3, the window is resized, and the extra area has been painted. Is it possible somehow to hide setp 2? Can I suspend the resizing process until the painting action is done? Here's an example: #include <Windows.h> #include <windowsx.h> #include <Uxtheme.h>

WinAPI Double-buffering

牧云@^-^@ 提交于 2019-12-03 08:25:34
A default winAPI application does not have double-buffering. Instead, it does a very, very good job of ensuring that only what needs to be drawn is drawn, and that gives it a seamless appearance. However, when you resize the window, the entire thing needs to be redrawn, and this causes flickering between the controls, the background on the tab, and sometimes the white of the tab. So my question is, what is the easiest way to support double buffering in my application? Create a bitmap the size of the window, render into that bitmap, and blit that back into the window when you're done. You can

Is it possible to eliminate flickering entirely when resizing a window?

自作多情 提交于 2019-12-03 06:43:23
Normally, even when using double buffering, when resizing a window, it seems that it's inevitable that the flickering will happen. Step 1, the original window. Step 2, the window is resized, but the extra area hasn't been painted. Step 3, the window is resized, and the extra area has been painted. Is it possible somehow to hide setp 2? Can I suspend the resizing process until the painting action is done? Here's an example: #include <Windows.h> #include <windowsx.h> #include <Uxtheme.h> #pragma comment(lib, "Uxtheme.lib") LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM

Double Buffer a JFrame

做~自己de王妃 提交于 2019-12-02 11:32:47
问题 I have been reading a lot about Double Buffering as I am working on a 2D game. I have come across many different strategies for implementation, but am unsure how Double Buffering would fit into the way I have created my game window. For example, one article I came across (http://content.gpwiki.org/index.php/Java:Tutorials:Double_Buffering) suggested having a separate method for drawing; however, I suspect this would be applicable if you were drawing shapes, instead of adding components to the