Slidshow,Bilder Laufen nicht gleichmäßig durch

  • VB6

Es gibt 1 Antwort in diesem Thema. Der letzte Beitrag () ist von Hadinius.

    Slidshow,Bilder Laufen nicht gleichmäßig durch

    Hallo
    In meinen Programm befinden sich zwei Formen.1 Form=CATCH_Alarm,2 Form=CATCH_Bilder.
    In CATCH_Alarm laufen die Bilder aus einem Ordner von Links nach Rechts in einer PitureBox durch.Ich kann den Abstand(400),Höhe(300) und Breite(412) selbst bestimmen.
    In CATCH_Bilder wird das Bild das gerade in CATCH_Alarm durch läuft,auf die Grösse 640x480 gestrecht und angezeigt.
    Wenn ich aber in CATCH_Alarm den Abstand oder Breite Ändere,laufen die Bilder in CATCH_Bilder schneller oder langsammer durch.
    Ich habe versucht mit CATCH_Bilder.PaintPicture LoadPicture(File1.path & "\" & File1.List(Z2)), 0, 0, Breite, Hoehe das Aktuelle Bild zu Übergeben,damit alles gleich läuft,
    weil bei einem Alarm das Bild von CATCH_Bilder gespeichert wird und es das gleiche Bild sein muss was gerade in CATCH_Alarm durch läuft.Ich bekomme aber immer die Fehler Meldung Ungültiges Bild in CATCH_Bilder
    .PaintPicture .Picture, 0, 0, .ScaleWidth, .ScaleHeight.
    und
    .PaintPicture Image1.Picture, 0, 0, .ScaleWidth, .ScaleHeight
    Kann mir vieleicht jemand Helfen ,wo ich den Fehler mache. ?(
    Eigentlich möchte ich auch in CATCH_Bilder den durchlauf des Bildes weg nehmen ,weil eigentlich nur das Bild Angezeigt werden muss was in CATCH_Alarm gerade geladen wird.

    Ich hoffe das mir jemand Helfen kann und das was ich geschrieben habe ,auch zu verstehen ist ;(
    Hadinius


    Brainfuck-Quellcode

    1. CATCH_Alarm=
    2. Public Sub Timer1_Timer()
    3. Me.lblStopuhr.Caption = Format$(Now - mdatStartzeit, "hh:mm:ss")
    4. If Text2.Text = "" Then
    5. Text2.Text = 2
    6. End If
    7. Dim i&
    8. 'Dim TeilBreite&, TeilHoehe&
    9. Breite = CInt(Text4.Text) ' Bildbreite
    10. Hoehe = CInt(Text5.Text) ' Bildhöhe
    11. Abstand = CInt(Text6.Text) 'Abstand zwischen den Bildern
    12. Speed = CInt(Text2.Text) 'Geschwindigkeit
    13. CATCH_Bilder.Text2.Text = Speed
    14. With Picture1
    15. For i = 0 To Speed - 1
    16. Z1 = Z1 - 1
    17. If Z1 = 0 Then
    18. Z1 = Breite + Abstand
    19. On Error GoTo 0
    20. .PaintPicture LoadPicture(File1.path & "\" & File1.List(Z2)), 0, 0, Breite, Hoehe
    21. [b]CATCH_Bilder.Picture2.Picture = LoadPicture(File1.path & "\" & File1.List(Z2))[/b]
    22. '------------------------------------------------------------------------------------------------------------------------------------
    23. Z2 = (Z2 + 1) Mod File1.ListCount
    24. End If
    25. Call BitBlt(.hdc, 1, 0, .ScaleWidth + 1, Hoehe + 400, .hdc, 0, 0, vbSrcCopy)
    26. Picture1.Line (0, -10)-(0, Hoehe), .BackColor
    27. Next i
    28. End With
    29. If Z2 > 0 Then
    30. Text7.Text = Z2 + 1
    31. End If
    32. Text1.Text = Z2
    33. Text8.Text = File1.path
    34. Text9.Text = File1.List(Z2)
    35. If Text1.Text = 0 Then
    36. Timer1.Enabled = False
    37. Z2 = 0
    38. Text3.Text = Text1.Text
    39. '------------------------------------------------------------------
    40. Z1 = 1
    41. '------------------------------------------------------------------
    42. End If
    43. End Sub
    44. CATCH_Bilder=
    45. Public Sub Timer1_Timer()
    46. Me.lblStopuhr.Caption = Format$(Now - mdatStartzeit, "hh:mm:ss")
    47. If Text2.Text = "" Then
    48. 'Text2.Text = 2
    49. End If
    50. Dim i&
    51. Dim TeilBreite&, TeilHoehe&
    52. Breite = CInt(Text4.Text) ' Bildbreite
    53. Hoehe = CInt(Text5.Text) ' Bildhöhe
    54. Abstand = CInt(Text6.Text) 'Abstand zwischen den Bildern
    55. Speed = CInt(Text2.Text) 'Geschwindigkeit
    56. With Picture1
    57. 'Speed = 15
    58. For i = 0 To Speed - 1
    59. Z1 = Z1 - 1
    60. If Z1 = 0 Then
    61. Z1 = Breite + Abstand
    62. On Error GoTo 0
    63. '--------------Picture2.Picture = LoadPicture(File1.path & "\" & File1.List(Z2))
    64. '------------------Bild-Strechen--------------------------------------------
    65. With Picture2
    66. .AutoRedraw = True
    67. .Cls
    68. [b].PaintPicture .Picture, 0, 0, .ScaleWidth, .ScaleHeight[/b]
    69. .AutoRedraw = False
    70. End With
    71. Me.ScaleMode = vbPixels
    72. With Picture2
    73. .BorderStyle = vbBSNone
    74. .ScaleMode = vbPixels
    75. .Width = 640 ' Breite Pixel
    76. .Height = 480 ' Höhe Pixel
    77. .AutoRedraw = True
    78. '.Cls
    79. [b].PaintPicture Image1.Picture, 0, 0, .ScaleWidth, .ScaleHeight[/b]
    80. End With
    81. '-------------------------------------------------------------------------
    82. Z2 = (Z2 + 1) Mod File1.ListCount
    83. End If
    84. Call BitBlt(.hdc, 1, 0, .ScaleWidth + 1, Hoehe, .hdc, 0, 0, vbSrcCopy)
    85. Picture1.Line (0, -10)-(0, Hoehe), .BackColor
    86. Next i
    87. End With
    88. If Z2 > 0 Then
    89. Text7.Text = Z2 + 1
    90. End If
    91. Text1.Text = Z2
    92. 'Text8.Text = File1.path
    93. 'Text9.Text = File1.List(Z2)
    94. If Text1.Text = 0 Then
    95. Timer1.Enabled = False
    96. Z2 = 0
    97. Text3.Text = Text1.Text
    98. '------------------------------------------------------------------
    99. Z1 = 1
    100. '------------------------------------------------------------------
    101. End If
    102. End Sub

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „Hadinius“ ()