-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webcal video flickering with SWT_AWT bridge under Windows #467
Comments
i've found a workaround in this thread : https://bugs.eclipse.org/bugs/show_bug.cgi?id=91157 The solution that worked for me was to override |
Hi @fbuloup, So just for the further reference, the solution is to override Composite composite = new Composite(parent, SWT.EMBEDDED | SWT.BORDER);
Frame frame = SWT_AWT.new_Frame(composite);
canvas = new Canvas() {
public void update(Graphics g) {
if(image != null) {
g.drawImage(image, 0, 0, canvas.getWidth(), canvas.getHeight(), 0, 0, image.getWidth(), image.getHeight(), null);
}
}
}; |
Hello Sarxos, from my experience, if you simply override Updates this canvas. Note that Main problem comes from the fact that the canvas is cleared before calling Here is my code at the end : // Make sure sun.awt.noerasebackground property has been set to true in activator
composite = new Composite(parent, SWT.EMBEDDED | SWT.BORDER | `SWT.NO_BACKGROUND);
Frame frame = SWT_AWT.new_Frame(composite);
canvas = new Canvas() {
@Override
public void paint(Graphics g) {
if(image != null) {
g.drawImage(image, 0, 0, canvas.getWidth(), ``canvas.getHeight(), 0, 0, image.getWidth(), image.getHeight(), null);
} else {
g.setColor(Color.BLACK);
g.fillRect(0, 0, canvas.getWidth(), canvas.getHeight());
}
}
// Override update to avoid background flickering
@Override
public void update(Graphics g) {
paint(g);
}
};
frame.add(canvas); Hope it's clear without any flickering ! |
Hi @fbuloup, Thank you for a detailed explanation :) I will mark this issue as closed. |
Hello !
I have read this issue : #91
I think I am trying to do the same thing and get also flickering in AWT canvas under Windows.
With exactly the same code under MacOSX, there is absolutely no flickering !
Did you solve the problem under Windows ? Someone have a solution ?
Here is my little code :
Windows 7 - 64 bits - Logitech HD C920
Thanks.
The text was updated successfully, but these errors were encountered: