I'm very new to PB and this forum. I googled for the feature "Capture Screenshot from Movie" and found the absolute fantastic codeexample from Freak (posted at 04/23/2003).
Then I decide to buy PB and write my own VideoLibrary. All works very great with one exception:
The Capture-Routine makes the screenshot. Here is the codefragment:
Code: Select all
;capture the current frame and stores it into ImageData
Procedure.l CaptureFrame(MovieNumber, ImageNumber, MemoryBank)
Protected *Movie.PB_StructureMovie, *Video.IBasicVideo, *Window.IVideoWindow
Protected *ImageData.BITMAPINFOHEADER, DataSize, Parent, Result
!extrn _PB_Movie_ObjectsArea
!MOV eax, [_PB_Movie_ObjectsArea]
!MOV [esp+12], eax
*Movie + MovieNumber * SizeOf(PB_StructureMovie)
*Window = *Movie\Window
*Video = *Movie\Video
Result = 0
If *Video\GetCurrentImage(@DataSize, 0) = #S_OK
*ImageData = AllocateMemory(DataSize)
If *ImageData
If *Video\GetCurrentImage(@DataSize, *ImageData) = #S_OK
Result = SetDIBits_(0, UseImage(ImageNumber), 0, *ImageData\biHeight, *ImageData + *ImageData\biSize, *ImageData, #DIB_RGB_COLORS)
EndIf
FreeMemory(MemoryBank)
EndIf
EndIf
ProcedureReturn Result
EndProcedure

The original post from freak: viewtopic.php?t=9384&highlight=pbmovieobjectsarea
Greetings and many thanks in advance,
Perni
PS: At last I have to say: I'm really enthused about PureBasic. I came from VB6/VB.NET, but PB is much more easier. Already after spending a few hours, I'm able to create complex Solutions and compile Libraries. And the language has a lot of very mighty BuildIn-Commands. That's really great.