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