Clear problem
Clear problem
Clear problem
Clear problem
Clear problem
Clear problem Clear problem Clear problem Clear problem Clear problem Clear problem Clear problem Clear problem
Clear problem Clear problem
Clear problem
Go Back  Xtreme Visual Basic Talk > > > Clear problem


Reply
 
Thread Tools Display Modes
  #1  
Old 06-27-2006, 12:52 PM
Izac_boy9 Izac_boy9 is offline
Freshman
 
Join Date: Apr 2005
Posts: 47
Question Clear problem


Hi!

I have a picture box which i am drawing on. Here's the code i am using:
Code:
Private sub timer_tick

Picture1.creategraphics.clear(Color.white)

for i = 1 to 999
Picture1.creategraphics.drawstring( i ,font, brushes.black , i * 25 - SCROLLBAR.value , 0 )
next i

End sub
The problem is when the screen clears white, you can see flashes of white.

Is there anyway to fix this? i remember it never done this in vb6.

Any help would be great thanks!

P.S:The code might not be EXACLY right, becuase i am not at vb.net at the moment. but you should be able to understand it.
__________________
()_)__Crayon__))>
Reply With Quote
  #2  
Old 06-28-2006, 09:02 AM
JNewt's Avatar
JNewt JNewt is offline
Centurion
 
Join Date: Apr 2003
Location: KY (Home), ID (College)
Posts: 138
Default

The flashing is most likely a result of all the overhead you've got going there. Every time that timer ticks, you're calling CreateGraphics about 1000 times. So I recommend 2 things: 1) write a better organized (and more proper) sub (check out this site for info on better ways to do this stuff: http://www.bobpowell.net/faqmain.htm) and 2) learn about double buffering.
__________________
Erat autem fuenum multum in loco. -John 6:10
Please forgive my English -I'm a modern American.
Reply With Quote
  #3  
Old 06-28-2006, 10:48 AM
Izac_boy9 Izac_boy9 is offline
Freshman
 
Join Date: Apr 2005
Posts: 47
Default

This never happened in vb6 and i used toput it throught more than 8000 drawing function
__________________
()_)__Crayon__))>
Reply With Quote
  #4  
Old 06-28-2006, 04:13 PM
JNewt's Avatar
JNewt JNewt is offline
Centurion
 
Join Date: Apr 2003
Location: KY (Home), ID (College)
Posts: 138
Default

Well, you can get performance similar to VB6 out of .Net-- just not the way you're doing it. The suggestions in my earlier post will help you find the proper way of doing things.
__________________
Erat autem fuenum multum in loco. -John 6:10
Please forgive my English -I'm a modern American.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Clear problem
Clear problem
Clear problem Clear problem
Clear problem
Clear problem
Clear problem Clear problem Clear problem Clear problem Clear problem Clear problem Clear problem
Clear problem
Clear problem
 
Clear problem
Clear problem
 
-->