Flickering is a sign that it is not doublebuffered or you are drawing on the wrong surface or flipping too soon. Double buffering is: Create a primary surface with one backbuffer (essentially 2 display surfaces) Always draw on the backbuffer (it is not visible) and when all drawing is complete swap the 2 surfaces. the swapping makes the backbuffer the primary and the primary becomes the backbuffer this is what prevents flickering, the instantanious swap of the source display surface. I haven't used the above drawing methods only DirectX and some GDI so i could be totally wrong about your code. It appears you are creating/initializing your drawing surfaces (this.CreateGraphics()) repeatedly....this should only be done once. - Where does it create your drawing surface Doublebuffered? - How does x.DrawLine know which surface of X to draw on? I also see "new" several times within you while(true) loop but no "delete" unless their is some sort of garbage collection for memory eventually you'll run out. Another issue you could have is since the drawing is in it's own thread....when the main form/window needs to refresh, it needs to know what to draw (the primary surface) or let the drawing thread know it needs to refresh the display area that it is handling. Hope this helped.
ntrceptr
Posts
-
Multithreaded drawing -
Gods Of COBOLDougs' replay was the closest thing to correct so far. 01 MEMORY-AREA-ONE PIC X(2816). This just defines a 2816 byte vaariable and the PIC X means it's alphanumeric 01 REDEFINES MEMORY-AREA-ONE This says your going to redefine that chunk of data into a different structure/layout 05 K01-1 OCCURS 37 TIMES INDEXED BY K01-1-X PIC 9(04) COMP-5. These 2 lines make an array of 37 four digit numbers (0000-9999) and gives you a subscript named K01-1-X to reference entries 1-37 remember COBOL subscripts start at 1 not zero. This K01-1 array actually exists in the first 74 bytes of MEMORY-AREA-ONE The COMP-5 or any COMP in COBOL basicall says to save space by representing the numbers in memory (like they should) in a binary format. COBOL will basically use a string for numbers is you don't use COMP (1 byte for each digit) 05 K02-1 OCCURS 1369 TIMES INDEXED BY K02-1-X PIC 9(04) COMP-5. This is basically the same except it uses bytes 75-2812 of MEMORY-AREA-ONE to define and array of 1369 four digit numbers and gives you subscript K02-1-X to reference it. I'd say the original author didn't quite understand COBOL either as you dont need to define extra space in the MEMORY-AREA-ONE for the subscripts. if it was 01 MEMORY-AREA-ONE PIC X(2812) it would have worked the same.