-
VideoHdr to hDC or StdPicture
I'm banging my head against the desk at the moment while studying 8 pages of cDibSection.
I have a video header (or a pointer) and I cant find anyway at all to put it onto an hdc or stdpicture
Any help appreciated
--
Dean Earley (dean.earley@icode.co.uk)
Assistant Developer
iCode Systems
-
Re: VideoHdr to hDC or StdPicture
"Dean Earley" <dean.earley@icode.co.uk> wrote:
>I'm banging my head against the desk at the moment while studying 8 pages
of cDibSection.
>
>I have a video header (or a pointer) and I cant find anyway at all to put
it onto an
>hdc or stdpicture
>
>Any help appreciated
>
>--
>Dean Earley (dean.earley@icode.co.uk)
>Assistant Developer
>
>iCode Systems
>
>
If you have a pointer to the pixel's data ( Gptr) you can tranfer it to a
Device Context.
CoDc = CreateCompatibleDC(0) '
bi.bmiHeader.biSize = 40
bi.bmiHeader.biWidth = cWidth' Your Header Width
bi.bmiHeader.biHeight =cHeight ' Your Header Height
bi.bmiHeader.biPlanes = 1
bi.bmiHeader.biBitCount = 24
bi.bmiHeader.biCompression = BI_RGB
DIBSectionHandle = CreateDIBSection(CoDc, bi, DIB_RGB_COLORS, address,
0, 0)
OldCompDCBM = SelectObject(CoDc, DIBSectionHandle)
' Gptr Your Pointer to Pixel's data
StretchDIBits CoDc, 0, 0, cWidth, cHeight, 0, 0, cWidth, cHeight, ByVal
Gptr&, bi, DIB_RGB_COLORS, vbSrcCopy
' CoDc is now a Device context with your image .
-
Re: VideoHdr to hDC or StdPicture
Thanks I'll Try that
Also, is there a recommended way of drawing onto a StdPicture without an associated PictureBox. I think the StdPicture.Handle is a
pointer to a bitmap structure.
Thanks
--
Dean Earley (dean.earley@icode.co.uk)
Assistant Developer
iCode Systems
"Victor Pedroso" <vmf@ip.pt> wrote in message news:3ad37a67$1@news.devx.com...
>
> "Dean Earley" <dean.earley@icode.co.uk> wrote:
> >I'm banging my head against the desk at the moment while studying 8 pages
> of cDibSection.
> >
> >I have a video header (or a pointer) and I cant find anyway at all to put
> it onto an
> >hdc or stdpicture
> >
> >Any help appreciated
> >
> >--
> >Dean Earley (dean.earley@icode.co.uk)
> >Assistant Developer
> >
> >iCode Systems
> >
> >
>
> If you have a pointer to the pixel's data ( Gptr) you can tranfer it to a
> Device Context.
>
>
>
> CoDc = CreateCompatibleDC(0) '
> bi.bmiHeader.biSize = 40
> bi.bmiHeader.biWidth = cWidth' Your Header Width
> bi.bmiHeader.biHeight =cHeight ' Your Header Height
> bi.bmiHeader.biPlanes = 1
> bi.bmiHeader.biBitCount = 24
> bi.bmiHeader.biCompression = BI_RGB
>
>
> DIBSectionHandle = CreateDIBSection(CoDc, bi, DIB_RGB_COLORS, address,
> 0, 0)
> OldCompDCBM = SelectObject(CoDc, DIBSectionHandle)
> ' Gptr Your Pointer to Pixel's data
>
> StretchDIBits CoDc, 0, 0, cWidth, cHeight, 0, 0, cWidth, cHeight, ByVal
> Gptr&, bi, DIB_RGB_COLORS, vbSrcCopy
>
> ' CoDc is now a Device context with your image .
>
>
>
>
-
Re: VideoHdr to hDC or StdPicture
"Dean Earley" <dean.earley@icode.co.uk> wrote:
>Thanks I'll Try that
>
>Also, is there a recommended way of drawing onto a StdPicture without an
associated
>PictureBox. I think the StdPicture.Handle is a
>pointer to a bitmap structure.
>
>Thanks
>
>--
>Dean Earley (dean.earley@icode.co.uk)
>Assistant Developer
>
>iCode Systems
>"Victor Pedroso" <vmf@ip.pt> wrote in message news:3ad37a67$1@news.devx.com...
>>
>> "Dean Earley" <dean.earley@icode.co.uk> wrote:
>> >I'm banging my head against the desk at the moment while studying 8 pages
>> of cDibSection.
>> >
>> >I have a video header (or a pointer) and I cant find anyway at all to
put
>> it onto an
>> >hdc or stdpicture
>> >
>> >Any help appreciated
>> >
>> >--
>> >Dean Earley (dean.earley@icode.co.uk)
>> >Assistant Developer
>> >
>> >iCode Systems
>> >
>> >
>>
>> If you have a pointer to the pixel's data ( Gptr) you can tranfer it to
a
>> Device Context.
>>
>>
>>
>> CoDc = CreateCompatibleDC(0) '
>> bi.bmiHeader.biSize = 40
>> bi.bmiHeader.biWidth = cWidth' Your Header Width
>> bi.bmiHeader.biHeight =cHeight ' Your Header Height
>> bi.bmiHeader.biPlanes = 1
>> bi.bmiHeader.biBitCount = 24
>> bi.bmiHeader.biCompression = BI_RGB
>>
>>
>> DIBSectionHandle = CreateDIBSection(CoDc, bi, DIB_RGB_COLORS, address,
>> 0, 0)
>> OldCompDCBM = SelectObject(CoDc, DIBSectionHandle)
>> ' Gptr Your Pointer to Pixel's data
>>
>> StretchDIBits CoDc, 0, 0, cWidth, cHeight, 0, 0, cWidth, cHeight,
ByVal
>> Gptr&, bi, DIB_RGB_COLORS, vbSrcCopy
>>
>> ' CoDc is now a Device context with your image .
>>
>>
>>
>>
>
>
Hi
I think the StdPicture.Handle is not a pointer.
Anyway the mothods i know to fill a StdPicture object are :
1 - Stpi As StdPicture
Set Stpi = LoadPicture("C:\test.bmp") ' or test.jpg
2 - Or using the Render method of StdPicture object
( Never tried this)
Victor Pedroso
VMF@ip.pt
-
Re: VideoHdr to hDC or StdPicture
> I think the StdPicture.Handle is not a pointer.
Returns a handle to the graphic contained within a Picture object.
My mistake
> 1 - Stpi As StdPicture
> Set Stpi = LoadPicture("C:\test.bmp") ' or test.jpg
> 2 - Or using the Render method of StdPicture object
> ( Never tried this)
Only draws from the StdPicture to an hDc
--
Dean Earley (dean.earley@icode.co.uk)
Assistant Developer
iCode Systems
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|