all groups > dotnet clr > february 2007 >
You're in the

dotnet clr

group:

create bitmap from a pointer in vb.net?



Re: create bitmap from a pointer in vb.net? Patrick Steele
2/6/2007 5:39:23 PM
dotnet clr: In article <#7kzlDjSHHA.2188@TK2MSFTNGP03.phx.gbl>, vcreb@hotmail.com
says...
[quoted text, click to view]

This is a guess, but you could try using the Marshal.Copy() method to
copy from unmanaged memory into a byte[], then create the Bitmap from
the byte[].

--
Patrick Steele
create bitmap from a pointer in vb.net? Victor Reboucas
2/6/2007 6:53:44 PM
Hi, I'm a VB.Net developer and cannot find a way to create a bipmap from a
pointer...

My application does video rendering using Windows media encoder (that's out
of the content of this message). Using a "DataView" object I can attach a
"video viewer" to about every control in a Form, using a "integer reference"
to attach the viewer object to the control you want to use as a viewer.

Question: is there any way to use the "lpreviewStream" integer to generate a
bitmap using BitBlt, new Bitmap(...) or some other way? (I'm trying to get
screen shots of the video on screen)

Here's part of the code, when I create the viewer and attach it to a
pictureBox:

(thanks for any clue)

-->> SrcVid is the Encoder object that gives you the video from
a device

DVColl_Preview = SrcVid.PreviewCollection

'Create WMEncDataView object
Preview = New WMEncDataView

'Add the WMEncDataView objects to the collection.
lpreviewStream = DVColl_Preview.Add(Preview)

'// Start the encoding process.
Encoder.PrepareToEncode(True)
Encoder.Start()

'// Display the preview in a pictureBox named pic1
Preview.SetViewProperties(lpreviewStream, pic1.Handle.ToInt32)
Preview.StartView(lpreviewStream)

Regards,
Victor

AddThis Social Bookmark Button