flicker

How to get rid of the flicker that appears during my animation?

北城余情 提交于 2019-12-10 11:13:31
问题 I'm learning Java by making a small game in a JApplet. I got a little problem with my sprite's animation. Here is the code : this.sprite.setBounds(0,0,20,17); this.sprite.setIcon(this.rangerDown); for(int i = 0; i< 16;i++) { this.sprite.setBounds(this.sprite.getX(), this.sprite.getY()+1, 20, 17); this.sprite.update(this.sprite.getGraphics()); try{ Thread.currentThread().sleep(100); }catch(InterruptedException e){ } } It left some flicker during the animation. Once the animation end, the

Flickering during resizing of HTML5 canvas

蓝咒 提交于 2019-12-10 10:33:38
问题 I'm observing some flickering during the resizing of an animated canvas control. You can see it in action at this page. Drag the 'width' slider left and right to try it for yourself. I see this flickering in Chrome 26.0.1410.43 running on Linux. Currently this page won't work in Firefox until it supports HTML5's <input type="range"> . I've tried to reproduce the issue on a smaller scale in this jsFiddle. It's not as noticeable, but occurs for me when the canvas is around 90% of the available

Zoom with OpenCV win32 C++

懵懂的女人 提交于 2019-12-08 06:46:21
问题 I have some OpenCV project that view image on static control and has zoom in / out functionality. Here what I got : void UpdateImage(HWND hwnd, int zoom) { if(img) { RECT rc; HWND hStatic = GetDlgItem(hwnd, IDC_IMG); HDC imgdc = GetDC(hStatic); GetClientRect(hStatic, &rc); HDC hdcMem = CreateCompatibleDC(imgdc); HBITMAP hbmMem = CreateCompatibleBitmap(imgdc, rc.right-rc.left, rc.bottom-rc.top); HGDIOBJ hbmOld = SelectObject(hdcMem, hbmMem); HBRUSH hbrBkGnd = GetSysColorBrush(COLOR_3DFACE);

sIFR load before rest of page?

浪子不回头ぞ 提交于 2019-12-08 05:40:27
Is it possible to have sIFR "preload" or load before the rest of the page content? At present it is the last thing to load (due to the text position) and as it's quite an obvious part of the page I get a huge mash-up of text replacement all in a quick flurry which is not very appealing. It looks like the site is having an epileptic fit. Once loaded, all is fine though :) Any work-arounds to the load-fitting? Cheers Hugh There are a two separate issues here: Replacing the elements as soon as possible Making the replacement as painless as possible For #1, sIFR by default replaces the elements on

Java Canvas repaint() is flickering

佐手、 提交于 2019-12-08 03:51:06
问题 So I finally got a Canvas to work the way I want it but it flickers constantly, repaint() is run 20 times a second and the flicking does lessen when I make it run 10 times a second. package pd.data; import java.awt.BorderLayout; import javax.swing.JFrame; import javax.swing.JPanel; import pd.areas.MainMenu; @SuppressWarnings("serial") public class Main extends JFrame implements Runnable { private JPanel contentPane = new JPanel(); private Thread gameThread = new Thread(this); public boolean

Flickering after resize despite the WS_EX_COMPOSIET flag and DoubleBuffered propertie

耗尽温柔 提交于 2019-12-07 20:45:18
问题 I have a TableLayoutPanel where I do some Drag&Drop stuff with the controls inside the layout. Unfortunately the controls are flickering after the drop action. I tried DoubleBuffered=true on all controls and a lot of other things. I also tried this solution: How to fix the flickering in User controls. And actually it works pretty well with the mentioned CreateParams. But only until I resize the form. It seems that windows forgets the WS_EX_COMPOSIET flag after a resize. It appears only with

MFC: How to avoid flickering in child-control updates?

这一生的挚爱 提交于 2019-12-07 14:51:42
问题 I'm been googling for days, and all I'm getting are the same answers, but is not what I want (I will describe what I do not want later). What I want is: Say I have a parent dialog that has a few CStatic child controls. The parent dialog uses black as its background when in focus, and gray when not in focus. The child static controls simply display text, but its background needs to follow the parent's background color Problem: I can get the child-controls to always track the parent's color,

C# - Moving a control to the mouse's position

人走茶凉 提交于 2019-12-07 14:27:02
问题 I am trying to get a control to follow the cursor when the user clicks and drag the control. The problem is that 1.) the control doesn't go to the mouse's position, and 2.) the control flickers and flies all over the place. I've tried a few different methods of doing this, but all so far have failed. I've tried: protected override void OnMouseDown(MouseEventArgs e) { while (e.Button == System.Windows.Forms.MouseButtons.Left) { this.Location = e.Location; } } and protected override void

Flickering and “CreateParams”

随声附和 提交于 2019-12-07 10:20:38
问题 I want to avoid flickering in a panel of my application, after googling from 4 monthgs ago, after trying subclassed panels, after asking here two or three times, after asking in other forums... nobody has the solution but today I've found the solution by a miracle in this last answer: Is their a way to stop the picturebox from flickering when being resized? Protected Overrides ReadOnly Property CreateParams() As CreateParams Get Dim cp As CreateParams = MyBase.CreateParams cp.ExStyle = cp

Static controls slightly flicker when main window is resized

久未见 提交于 2019-12-07 06:07:24
问题 INTRODUCTION AND RELEVANT INFORMATION: I have a complex painting to implement in my main window’s WM_PAINT handler. I have submitted a picture bellow to illustrate it: Main window has static controls, instead of buttons, which have style SS_NOTIFY . When user clicks on them, certain actions occur in program. The following picture shows where static controls in the main window are: Map on the orange panel is an EMF file ,top left and right logos are PNG files, and other pictures are bitmaps.