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

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

Robbie
100+
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)
  3.  
  4.     TempReturn = mciSendString(SendString, 0&, 0, 0)
  5.  
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
  7.  
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.