GIDForums  

Go Back   GIDForums > Computer Programming Forums > .NET Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 11-Mar-2009, 05:00
cgillopez cgillopez is offline
New Member
 
Join Date: Aug 2008
Posts: 12
cgillopez is an unknown quantity at this point

paint doesn't refresh


Hello,

Im trying to paint the movement i get from my joystick. I dont have any exceptions and the code flows by the paint line but in the form i only get a line from the initial point (0,0) --(form.width/2, form.height/2)

To do the poll from the joystick i have a thread.. it would be the problem? i mean, the refresh is so fast that i can see the change??


While WindowHasFocus = True
jst.UpdateStatus()
PosicionDesplazamiento = New Point((jst.AxisX * Me.Width) / 65535, (jst.AxisY * Me.Height) / 65535)

Console.Out.WriteLine("X " & PosicionDesplazamiento.X & "; Y " & PosicionDesplazamiento.Y)

PaintControl()

System.Threading.Thread.Sleep(500)
Application.DoEvents()
End While


***************
Private Sub PaintControl(ByVal aGraphics As Drawing.Graphics)
Dim grafx As BufferedGraphics

mutPintado.WaitOne()
try

grafx.Graphics.DrawLine(Pens.Red, PosicionDesplazamiento.X, PosicionDesplazamiento.Y, CInt(Me.Width / 2), CInt(Me.Height / 2))

grafx.Render(aGraphics)
Finally
grafx.Dispose()
End Try
Finally
mutPintado.ReleaseMutex()
End Try


Thanks in advance for your help.
 
 

Recent GIDBlogProblems with the Navy (Chiefs) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Misunderstanding curses refresh()? Catus C++ Forum 9 17-Jun-2008 05:50
CreateDIBitmap won't paint toolmanx C++ Forum 1 05-Jan-2008 16:23
auto refresh help exchanged for $$$ pleasehelpmeout Computer Programming Advertisements & Offers 0 16-Nov-2007 11:47
Microsoft Paint Simulated Mouse Click Fromethius C++ Forum 1 23-Aug-2007 20:03
Paint help bilbo123 Java Forum 1 11-Jun-2006 20:57

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 17:39.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.