Results 1 to 19 of 19

Thread: Can't DRAW!!! DAMN FLICKER!!!

Threaded View

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Angry Can't DRAW!!! DAMN FLICKER!!!

    excuse my anger, but I AM angry!! been playing with this for 2 days and still doesnt work!

    This is what my sample app is supposed to do: when the user moves the mouse, it's suppose to draw an alpha blended rectangle over the form's background image. As the mouse moves, the rectangles gets larger or smaller, depending on the mouse position on the form. The problem is that it FLICKERS and it doesnt WORK!!!!!

    Here's what it SHOULD look like:


    but it doesnt work. here's my code:
    VB Code:
    1. Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove
    2.         Dim gr As Graphics = Me.CreateGraphics
    3.         Dim rgn As New Region(New Rectangle(0, 20, e.X, Me.ClientSize.Height - 45))
    4.         Dim myBrush As New SolidBrush(Color.FromArgb(50, 0, 0, 0))
    5.  
    6.         ' THIS EVIL MAKES IT FLICKER!!!!!
    7.         ' I cant use gr.Clear because it erases the background image
    8.         Me.Invalidate()
    9.  
    10.         gr.FillRegion(myBrush, rgn)
    11.         gr.Dispose()
    12.  End Sub

    I have the code in a project, it would be nice if you download it, because you can clearly see what I mean by flicker when you run the app
    Attached Files Attached Files
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width