CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 1999
    Location
    Bahrain
    Posts
    13

    Coverting a Frame of AVI to BMP

    Given an AVI File and a Framr No in that, How can I convert and save that Frame No to a BMP Format?


  2. #2
    Join Date
    Sep 1999
    Location
    Red Wing, MN USA
    Posts
    312

    Re: Coverting a Frame of AVI to BMP

    Here's an old bit of code I created a while back, which creates a bitmap of the Frames in an AVI/MOV File using the Active Movie Control and a Picturebox..

    private Declare Function GetDC Lib "user32" (byval hwnd as Long) as Long
    private Declare Function BitBlt Lib "gdi32" (byval hDestDC as Long, byval x as Long, byval y as Long, byval nWidth as Long, byval nHeight as Long, byval hSrcDC as Long, byval xSrc as Long, byval ySrc as Long, byval dwRop as Long) as Long
    private Const SRCCOPY = &HCC0020

    private Sub Command1_Click()
    Dim I as Integer
    Dim lDC as Long
    lDC = GetDC(amov.hwnd)
    Picture1.AutoRedraw = true
    for I = 0 to amov.Duration
    amov.CurrentPosition = I
    Call BitBlt(Picture1.hdc, I * amov.ImageSourceWidth, 0, amov.ImageSourceWidth, amov.ImageSourceHeight - 5, lDC, 0, 0, SRCCOPY)
    next
    Call SavePicture(Picture1.Image, "C:\AVIFrames.bmp")
    End Sub

    private Sub Form_Load()
    Picture1.ScaleMode = vbPixels
    Picture1.Width = ScaleX(amov.ImageSourceWidth * (amov.Duration + 1), vbPixels, vbTwips)
    Picture1.Height = ScaleY(amov.ImageSourceHeight - 5, vbPixels, vbTwips)
    End Sub





    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]
    Aaron Young
    Senior Programmer Analyst (Red Wing Software)
    Certified AllExperts Expert

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

Featured