Intro Download and install Frequently Asked Questions Tips and tricks

Homepage







© J.C. Kessels 2009
MyDefrag Forum
June 19, 2013, 08:26:47 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: window repainting  (Read 1668 times)
roytam1
JkDefrag Senior
****
Posts: 20


View Profile
« on: March 18, 2009, 01:28:24 pm »

I found that MyDefrag 4.0b2 repaints when scrolling mouse wheel in main window. It even repaints when zoom = 1. I can see the main window blanks for a very short time and then repaints.
Logged
Huggu
JkDefrag Hero
*****
Posts: 58


View Profile
« Reply #1 on: March 19, 2009, 06:51:46 am »

I detected 2 situations where we should avoid zooming:
  • dont zoom out when already full zommed out
  • dont zoom in any direction when i use a mouse click to bring the program window in front (if the program is not the topmost, dont zoom)
Logged
jimbo
JkDefrag Hero
*****
Posts: 84


View Profile
« Reply #2 on: March 19, 2009, 10:26:40 am »

Related to your first point

Don't attempt to scroll on mouse-wheel movement when fully zoomed out, either.
Logged
roytam1
JkDefrag Senior
****
Posts: 20


View Profile
« Reply #3 on: March 19, 2009, 11:42:17 am »

Related to your first point

Don't attempt to scroll on mouse-wheel movement when fully zoomed out, either.
People will ask "Why? mouse wheel don't affect JkDefrag."
I think stop repainting when zoom = 1 in programmatical way will be the best solution.
Logged
jimbo
JkDefrag Hero
*****
Posts: 84


View Profile
« Reply #4 on: March 19, 2009, 12:15:25 pm »

Uhhh, isn't that what I said?

I was pointing out that it isn't just zoom-outs that you need to not repaint for, but also scroll attempts.
Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7156



View Profile WWW
« Reply #5 on: March 20, 2009, 02:37:49 am »

Thanks everybody for testing and for the feedback, I appreciate it! I will make a note and see what I can do.
Logged
schitzn
JkDefrag Hero
*****
Posts: 121



View Profile
« Reply #6 on: March 23, 2009, 01:48:50 pm »

I remember dealing with the BitBlt api and trying to deal with the flicker once myself in a windows app.

The way I dealt with it was create a seperate handle to hold the new painted contents, paint it to this memory handle, then bitblt it to the on-screen handle.  The flicker should cease. Oh, and dont forget to delete the memory handle.  Even better, create on program start and kill it on program exit to minimize overhead.

I coded in *looks around and whispers "vb", so the code I have wouldnt be useful to you being a C++ coder.
« Last Edit: March 23, 2009, 01:51:51 pm by schitzn » Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7156



View Profile WWW
« Reply #7 on: March 25, 2009, 12:01:17 am »

Thanks for the suggestion, but the redrawing described in this thread is not bitblt flicker. The program is actually redrawing the total diskmap, file by file. The MyDefrag v4 graphics are a complete rewrite, totally different and a lot faster than JkDefrag v3.
Logged
schitzn
JkDefrag Hero
*****
Posts: 121



View Profile
« Reply #8 on: March 25, 2009, 02:09:04 pm »

There is a white flicker that occurs during the paint process, normally this is due to a clearing of the graphics handle that gets called before the updated graphic is applied, and windows refreshes that clear request to screen prior to the updated graphic being applied.  To avoid the flicker, like a games programmer, one needs to utilize a backbuffer to draw the graphic offscreen and then flip it onto the on-screen buffer rather than using a clear, then dump directly onto the on-screen buffer.

Im assuming your using the GDI api of Windows to do your painting, so surely something around these lines would apply?
« Last Edit: March 25, 2009, 03:01:19 pm by schitzn » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!