Results 1 to 16 of 16

Thread: FLASHING image

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,926

    FLASHING image

    how to flashing two image ?
    attached the image

    alternate the two color image:

    yellow
    red
    yellow
    red
    ecc...
    Attached Images Attached Images   
    Last edited by luca90; May 27th, 2026 at 02:23 AM.

  2. #2
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,735

    Re: FLASHING image

    Timer and 2 picture boxes?

  3. #3
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    5,262

    Re: FLASHING image

    Quote Originally Posted by Arnoutdv View Post
    Timer and 2 picture boxes?
    Timer and 1 PictureBox, but 2 BitMaps.
    Just Load alternate BitMap on Timer-Event, or load both into Memory, and then just assign on Timer-Event
    Probably needs Repainting/Refresh, too.

    If it's really just those small squares, a Label might be an Option.
    No Caption, Autosize=False, Background opaque, and then just set Background-Color on Timer-Event
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,926

    Re: FLASHING image

    Quote Originally Posted by Zvoni View Post
    Timer and 1 PictureBox, but 2 BitMaps.
    Just Load alternate BitMap on Timer-Event, or load both into Memory, and then just assign on Timer-Event
    Probably needs Repainting/Refresh, too.

    If it's really just those small squares, a Label might be an Option.
    No Caption, Autosize=False, Background opaque, and then just set Background-Color on Timer-Event

    I think not is for me..E.
    can you post an example.?
    tks

  5. #5
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    10,910

    Re: FLASHING image

    Ask AI.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  6. #6
    Member
    Join Date
    Nov 2025
    Posts
    35

    Re: FLASHING image

    I that the job now, "Ask AI" when we know AI makes too many mustkes. Quote from AI. lol

  7. #7
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,671

    Re: FLASHING image

    Use a Shape, FillStyle = 0 (solid). Change the FillColor with a timer.

  8. #8
    The Idiot
    Join Date
    Dec 2014
    Posts
    3,002

    Re: FLASHING image

    what Arnoutdv wrote. this is where u start. u use what VB offers. its simple. its intuitive. its learning exercise.
    later when you ready, u will be ready for more.
    if u can't even use the common component of VB u should just quit trying. this after 20+ years.

  9. #9
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    5,262

    Re: FLASHING image

    Quote Originally Posted by Eduardo- View Post
    Use a Shape, FillStyle = 0 (solid). Change the FillColor with a timer.
    Nice.
    For some unfathomable reason, i always forget the Shape-Control.
    Probably because i never used it
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  10. #10

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,926

    Re: FLASHING image

    Quote Originally Posted by zvoni View Post
    nice.
    For some unfathomable reason, i always forget the shape-control.
    Probably because i never used it
    infact never used

  11. #11
    The Idiot
    Join Date
    Dec 2014
    Posts
    3,002

    Re: FLASHING image

    shape is good, but not as good as a picturebox.
    shape has the same issue like an image object, they can flicker.

    even so, to realize that, u need to try it. thats when u see the good and the bad.
    thats when u evolve and start looking for something that can fix the limitations.

  12. #12

  13. #13
    PowerPoster ChrisE's Avatar
    Join Date
    Jun 2017
    Location
    Frankfurt
    Posts
    3,129

    Re: FLASHING image

    nothing fancy...

    2x Shape
    1x Timer

    set your timer Interval as you need it

    Code:
    Private Sub Form_Load()
    Shape1.FillStyle = 0
    Shape1.Height = 330
    Shape1.Left = 2415
    Shape1.Top = 1995
    Shape1.FillColor = vbYellow
    
    Shape2.FillStyle = 0
    Shape2.Height = 330
    Shape2.Left = 2415
    Shape2.Top = 1995
    Shape2.FillColor = vbRed
    
    Timer1_Timer
    End Sub
    
    Private Sub Timer1_Timer()
    Shape2.Visible = Not Shape2.Visible
    End Sub
    to hunt a species to extinction is not logical !
    since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.

  14. #14
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    5,262

    Re: FLASHING image

    Alternative to Chris with 1 Shape
    Untested
    Code:
    Private col(0 To 1) As Long
    
    Private Sub Form_Load()
      col(0) = vbYellow
      col(1) = vbRed
      Shape1.FillStyle = 0
      'Where's "Width"? :)
      Shape1.Height = 330
      Shape1.Left = 2415
      Shape1.Top = 1995
      Shape1.FillColor = col(0)
      Timer1_Timer
    End Sub
    
    Private Sub Timer1_Timer()
    Static a As Long
      If a = 0 Then a = 1 Else a = 0
      Shape1.FillColor = col(a)
    End Sub
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  15. #15

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,926

    Re: FLASHING image

    Quote Originally Posted by ChrisE View Post
    nothing fancy...

    2x Shape
    1x Timer

    set your timer Interval as you need it

    Code:
    Private Sub Form_Load()
    Shape1.FillStyle = 0
    Shape1.Height = 330
    Shape1.Left = 2415
    Shape1.Top = 1995
    Shape1.FillColor = vbYellow
    
    Shape2.FillStyle = 0
    Shape2.Height = 330
    Shape2.Left = 2415
    Shape2.Top = 1995
    Shape2.FillColor = vbRed
    
    Timer1_Timer
    End Sub
    
    Private Sub Timer1_Timer()
    Shape2.Visible = Not Shape2.Visible
    End Sub
    GREAT CODE!!!!

    tested and work perfect
    tks bro!

  16. #16

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,926

    Re: FLASHING image

    Quote Originally Posted by Zvoni View Post
    Alternative to Chris with 1 Shape
    Untested
    Code:
    Private col(0 To 1) As Long
    
    Private Sub Form_Load()
      col(0) = vbYellow
      col(1) = vbRed
      Shape1.FillStyle = 0
      'Where's "Width"? :)
      Shape1.Height = 330
      Shape1.Left = 2415
      Shape1.Top = 1995
      Shape1.FillColor = col(0)
      Timer1_Timer
    End Sub
    
    Private Sub Timer1_Timer()
    Static a As Long
      If a = 0 Then a = 1 Else a = 0
      Shape1.FillColor = col(a)
    End Sub
    GREAT CODE!!!!

    tested and work perfect
    tks bro!

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