Results 1 to 7 of 7

Thread: Lose the filicker in Image Box??

  1. #1

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    Lose the filicker in Image Box??

    I have tried this but it flickers when changing.

    Form is Black Background
    Code:
    'Form keypress event
    
    Image1.visible=false
    Set Image1.Picture = nothing
    
    Select Case myAsci
      Case 97
      Set Image1.Picture = LoadPicture (myPathPic)
      Image1.visible = true
      Case bla bla
      etc.
    End Select
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  2. #2
    Lively Member FRAIL_KNIGHT's Avatar
    Join Date
    Nov 2001
    Posts
    100

    Unhappy

    I have no clue on how to reduce flicker. Microsoft probably added it on purpose....

    Try API Calls. I have no idea how to use them, but I hear they're fast.
    IF Something <> "" Then
    There's Something there...
    ------------------------------------------
    GWBASIC, QBASIC, QuickBASIC, VB5/6, A little DJGPP C++, and I hate it.
    ------------------------------------------
    The pic u see is the logo of my favorite Christian Punk Band...Officer Negative!!!

    www.OfficerNegative.com

  3. #3
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    u could try using the LockWindowUpdate API

    VB Code:
    1. Option Explicit
    2. Declare Function LockWindowUpdate Lib "user32" (ByVal hwnd As Long) As Long
    3.  
    4. Public Sub LockWindow(hwnd As Long)
    5.     'Låser et vindu slik at det ikke flimrer når data blir oppdat.
    6.     LockWindowUpdate hwnd
    7. End Sub
    8.  
    9. Public Sub UnlockWindow()
    10.     'Frigjør vinduet igjen.
    11.     LockWindowUpdate 0
    12. End Sub

    then in u'r form do this :
    VB Code:
    1. 'Form keypress event
    2.  
    3. [b]LockWindow Me.hwnd[/b]
    4.  
    5. Image1.visible=false
    6. Set Image1.Picture = nothing
    7.  
    8. Select Case myAsci
    9.   Case 97
    10.   Set Image1.Picture = LoadPicture (myPathPic)
    11.   Image1.visible = true
    12.   Case bla bla
    13.   etc.
    14.  
    15. [b]UnlockWindow[/b]
    16.  
    17. End Select

    that might do it ....
    -= a peet post =-

  4. #4
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    The Dark Side of the Moon
    Posts
    448
    I think you have to turn the Form's AutoRedraw off then use a technique called double buffering.

  5. #5

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    FRAIL_KNIGHT
    I have no clue as to how your answer is supposed to help . LOL

    Peet
    I have tried yours and it would seem to have a purpose for flickering once the picture is set, however, I am setting a picture and then displaying captions using pause and the whole process is now hid till the final caption is displayed so it can't work for my situtation.

    JaredM
    I will look into the buffering thing.

    ...I am not having a problem with flickering once the picture is set, it is when the picture is loading .. it flashes then loads the picture and I would really like to get rid of the flash.
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  6. #6
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    The Dark Side of the Moon
    Posts
    448

  7. #7
    Addicted Member Jez1's Avatar
    Join Date
    Oct 2001
    Location
    Warwickshire, England
    Posts
    185

    Image Box

    Try using a picture box instead of an Image box. They are supposed to flicker much less.

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