We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Dithering

sar70
sar70 asked
on
Medium Priority
231 Views
Last Modified: 2010-04-30
I am trying to simulate the dither action that
happens when you shutdown a win9.x machine. I
want to use this feature in a VB6 project I am
doing.
** Update **
      I tried the code but to no avial. I need a solution that will not change
      the properties of the form itself. The form I am trying to "dither' has many
      img & user controls on it. I want to dither that whole screen ( and it's contents ).
      When I just dither the form, the other user controls are not effected. I want to dither the
      entire screen then pop-up a message box.
Thanks,
Steve
ace@cyberspy.com
Comment
Watch Question

Commented:
It's somewhere in the KB of MS. As soon as I have more time I will look it up.

Commented:
You could download the following file, it shows you how to dither icons. It could be a start for you :
http://www.geocities.com/SiliconValley/Peaks/1797/iconproc.zip

Commented:
sar70,
The following code will dither a form for you.  I'm not sure if this is what you want.  If it is not, please expand on your question.

Regards,
Sekans

Sub Dither(vForm As Form)
Dim intLoop As Integer
vForm.DrawStyle = vbInsideSolid
vForm.DrawMode = vbCopyPen
vForm.ScaleMode = vbPixels
vForm.DrawWidth = 2
vForm.ScaleHeight = 256
For intLoop = 0 To 255
    vForm.Line (0, intLoop)-(Screen.Width, intLoop - 1), RGB(0, 0, 255 - intLoop), B
Next intLoop
End Sub

Author

Commented:
I tried the code but to no avial. I need a solution that will not change
the properties of the form itself. The form I am trying to "dither' has many
img & user controls on it. I want to dither that whole screen ( and it's contents )
when I pop a question dialog box to the user.

I also downloaded that file, but I do not know how to pull out the right code
to test it on my project.

Thanks,
Steve
ace@cyberspy.com

Author

Commented:
Edited text of question
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Thank you for the effort, the only problem I have now
is re-painting the form I dithered. I tried most of the
methods (autoredraw, paint, refresh ...) but none of which
fixed the user controls. The only way I have found to get
around it was to togle the visiblity on/off of the user control
but if you know a better way please tell me.
Thanks again for the time!   A+ !

Commented:
Changing a maximized form from Visible to Invisible and then back to Visible is the only way I can see to refresh the screen as well.   =]

HATCHET

Commented:
You can do an InvalidateRect or WM_PAINT. Just ask a question.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.