11011110110011011001100110011001000110011001100111010001011

March 26, 2007

Advance Graphics Mode in SWT.GC

Filed under: Programming

In KEmulator 0.7.7, I add rotation control to the Canvas, but it results in bugs on Infos Show!

1. the XOR Pen is disabled.
2. gc.drawRectangle with negative width/height has no efffect.

finally, i find out the reason — the advanced graphics subsystem of GC.

Normally, we can use GC.setAdvanced(boolean advanced) to switched into advanced mode. but the advanced graphics subsystem is invoked automatically when any one of the alpha, antialias, patterns, interpolation, paths, clipping or transformation operations in the receiver is requested. Refer to follows:

setAlpha setAntialias setBackgroundPattern setClipping(Path) setForegroundPattern setInterpolation setTextAntialias setTransform

So, before the Infos painting(drawRectangle/XOR ), use GC.setAdvanced(false) to return normal graphics subsystem.

 (the XOR rect comes back!)

1 Comment »

The URI to TrackBack this entry is: http://lyo.blogsome.com/2007/03/26/advance-graphics-mode-in-swtgc/trackback/

  1. none

    Comment by MDC — September 2, 2007 @ 5:00 am

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.