By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,134 Members | 1,265 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,134 IT Pros & Developers. It's quick & easy.

MCI video in PictureBox not blitting to another PictureBox (Overlaying?)

P: 180
Hi again.
I am using MCI to show a video file playing in a picturebox called PicVideo. (This works fine.)
Expand|Select|Wrap|Line Numbers
  1. SendString = "open " + Chr(34) + DialogStuff.FileName + Chr(34) + " type " + FileType + " alias asciivideofile"
  2.     SendString = SendString + " Parent " + Str(PicVideo.hWnd) + " Style " + Str(&H40000000)
  4.     TempReturn = mciSendString(SendString, 0&, 0, 0)
While the video plays, every so often (by a timer) I would like to copy what is in PicVideo at that instance to another picturebox (PicCopy):
Expand|Select|Wrap|Line Numbers
  1. BitBlt PicCopy.hDC, _
  2.             0, 0, _
  3.             PicWidth, PicHeight, _
  4.             PicVideo.hDC, _
  5.             0, 0, _
  6.             vbSrcCopy
I have used BitBlt before and it worked, but blitting this time just copies the background color of PicVideo to the other picturebox, as if the video is just being 'overlayed' onto the program, not really drawn into the PicVideo picturebox. (I made sure it really WAS blitting the backcolor by changing PicVideo's to orange and PicCopy's to gray, and sure enough it copied the orange background but no video frame.)

Is there a way to actually make VB 'draw' the video onto the picturebox so that blitting would then work? I have tried to search around but it seems there are not a lot of articles on how to do this so I'm really stuck.
Mar 30 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.