I'm not sure where is the picturebox and c++ binaries.

I assume that you got c++ dll library that use the directshow and
contain the interface that you add reference to your c# app.

Button and picturebox is in c#.

Then each time you press button, you assign bitmap1 to
pictureBox1.Image and invalidate it.
If you use VB.NET try to add DoEvents in the code.

Then how your c++ filter applied to the image is not clear.

Just make sure your bitmap manipulation is applied to the bitmap1.

If sure bitmap1 is updated, you should see the updated image in
pictureBox1.

On May 12, 7:32 am, Sebastian <[email protected]> wrote:
> Hello,
>
> 1. I have written a directshow ctransformfilter derived filter in c++.
> 2. I have written an interface for it as well, which I can use to pass
> the bitmap1.Scan0 property of a .net Bitmap as an IntPtr from my C#
> program.
> 3. I do pictureBox1.Image=bitmap1;
>
> When I press a button in my C# program, the filter steps forward by
> one frame (I use IMediaSeeking:SetPosition(currentTime+timePerFrame)
> in directshow, but I think this is not part of the problem).
> After pressing the button the transform filter manipulates the pixels
> of the C# Bitmap. When manipulation is finished for the current image
> of the directshow video stream, the filter sends a message to the
> window of my C# form and then after getting the message using an
> overwritten WndProc I do a PictureBox.Invalidate(). I would expect to
> see the manipulation of the bitmap immediately after Invalidate().
> However I see the image from the last step forward. When I wait for a
> while and press a form button, which in return does a
> picturebox.invalidate, then I see the changes in my bitmap.
>
> So my question is:
>
> I expected the picturebox refreshing itself directly from the bitmap.
> But this seems not to be the case. Is there a cache, which is used by
> the picturebox to draw the bitmap on the screen? Any other mechanism
> which I might not understand?
> How could I force the picturebox to reread the bitmap and show it
> immediately. Just redoing pictureBox1.Image=bitmap1 and the invalidate
> () did not have an effect.
>
> Thanks, Sebastian

Reply via email to