Re: Save image to file from memory by surturz
surturz
Sun May 11 23:12:01 CDT 2008
The namespace Microsoft.Win32.SafeHandles Namespace might also yield a clue.
I don't know anything about this namespace, but it looks promising.
--
David Streeter
Synchrotech Software
Sydney Australia
"SurturZ" wrote:
> I think you'll need to use Windows API calls.
>
> Maybe RtlMoveMemory?
>
> I wouldn't be surprised if VB.NET tries to frustrate you, though. VB.NET
> programmers aren't really meant to access memory directly.
>
>
>
> --
> David Streeter
> Synchrotech Software
> Sydney Australia
>
>
> "Jerry Spence1" wrote:
>
> > Thanks. My problem is how to get at the memory in the first place. Given the
> > pointer, how do I read it?
> >
> > -Jerry
> >
> >
> > "kimiraikkonen" <kimiraikkonen85@gmail.com> wrote in message
> > news:96a98ce9-747d-4d07-ad83-a4d943c36856@m73g2000hsh.googlegroups.com...
> > > On May 8, 4:50 pm, "Jerry Spence1" <jerry.spe...@somewhere.co.uk>
> > > wrote:
> > >> I am using a network camera that saves the image in a byte array in
> > >> memory
> > >> (via their ocx component, and in the OnNewImage event I can get the
> > >> pointer
> > >> to the image and the byte length as
> > >> e.lFrmBytes
> > >>
> > >> e.lPtrToImage
> > >>
> > >> How do I get at that array in memory and save it to disk? It seems to
> > >> suggest a pointer which is not supported in VB.
> > >>
> > >> -Jerry
> > >
> > > Hi Jerry,
> > > If you're able to copy image to clipboard (memory), you can simply
> > > retrieve it into a picturebox and save by using save method. First
> > > make sure image is copied to clipboard.
> > >
> > > ' To get image from clipboard
> > > PictureBox1.Image = Clipboard.GetImage
> > >
> > > ' Then save image with a proper path
> > > PictureBox1.Image.Save("image_path.jpg")
> > >
> > > Hope this helps,
> > >
> > > Onur
> >
> >
> >