Welcome Guest Search | Active Topics | Members

Bug in AVI processor... Options
Andiii
Posted: Thursday, April 01, 2004 5:27:00 AM
Rank: Member
Groups: Member

Joined: 4/1/2004
Posts: 2
Points: 0
hello,

I found a bug in your (very good) AVI processor I'm afraid!

If you try and run the following which opens an AVI, outputs a single frame to an image and closes the AVI... it works on the first cycle, but fails on the second. Obviously this is a very simple example, but it highlights the issue!!

I'm being pushed to get this project sorted out this week, so a quick response would be appreciated.

Regards Andy.

Code:
Sub form_load()

Me.Show
DoEvents
Dim TempReader As New AviReader
Debug.Print "1"
TempReader.Open App.Path & "\bum.avi"
Debug.Print TempReader.FramesPerSecond, TempReader.Height
Debug.Print "2"
Set Image1.Picture = TempReader.Frames(0).Picture
Debug.Print "3"
TempReader.Close
Debug.Print "4"
TempReader.Open App.Path & "\bum.avi"
Debug.Print TempReader.FramesPerSecond, TempReader.Height
Debug.Print "5"
Set Image1.Picture = TempReader.Frames(0).Picture 'fails here!!!
Debug.Print "6"
TempReader.Close
Debug.Print "7"
          
End Sub



output in immediate window:
_________________________________________
1
>>2 111
2
3
4
>>2 111
5
_________________________________________

Then error message:

Run time error 8000fff
Method "Picture" of object "IAviFrame" failed
Andrew
Posted: Monday, April 05, 2004 7:27:00 AM

Rank: Advanced Member
Groups: Administration , Member

Joined: 8/2/2003
Posts: 709
Points: 108
It seems there is a bug indeed. However I have found a workaround. I noticed that only Picture property fails, so to draw the frame, you can try to use Draw method. This method draws the frame to given HDC. Image control does not have HDC, but PictureBox does, so you should use it instead of Image. Here is an example of modified code:

Code:
    Me.Show
    DoEvents
    Dim TempReader As New AviReader
    Dim filename As String
    Picture1.AutoRedraw = True
    filename = "D:\[Test Files]\AVIS\drillrle.avi"
    Debug.Print "1"
    TempReader.Open filename
    Debug.Print TempReader.FramesPerSecond, TempReader.Height
    Debug.Print "2"
    TempReader.Frames(0).Draw Picture1.hDC, 0, 0
    Picture1.Refresh
    Debug.Print "3"
    TempReader.Close
    Debug.Print "4"
    TempReader.Open filename
    Debug.Print TempReader.FramesPerSecond, TempReader.Height
    Debug.Print "5"
    TempReader.Frames(0).Draw Picture1.hDC, 0, 0
    Picture1.Refresh


Draw attention, to avoid erasing the image everytime you move some window over the image, you should set PictureBox AutoRedraw property to True and call Refresh to update it.

Please let me know if you got any other questions.

Sincerely yours,
Andrew Simontsev from Aurigma Team
Andiii
Posted: Monday, April 05, 2004 7:33:00 AM
Rank: Member
Groups: Member

Joined: 4/1/2004
Posts: 2
Points: 0
Hi Andrew,

Thanks for the responce, but unfortunately I need to use the image box rather than the picture box for other reasons... one of which is that I can autostretch the image if it is part of a image box, but this is not possible in a picture box.

Any chance of fixing the bug, I'm guessing it's not a big one?

Many Thanks

Andrew
Andrew
Posted: Thursday, April 08, 2004 7:33:00 AM

Rank: Advanced Member
Groups: Administration , Member

Joined: 8/2/2003
Posts: 709
Points: 108
I have replied it via e-mail...

Sincerely yours,
Andrew Simontsev from Aurigma Team
Andrew
Posted: Friday, April 09, 2004 3:37:00 AM

Rank: Advanced Member
Groups: Administration , Member

Joined: 8/2/2003
Posts: 709
Points: 108
If anyone experiences the same problem, download the most recent version of AVI Processor.

Sincerely yours,
Andrew Simontsev from Aurigma Team
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Yet Another Forum.net version 1.9.1.6 running under Cuyahoga.
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.