0

I'm building application, which paints raw bitmap images on label's hdc using StrechDIBits.

ptr = g->GetHdc();
dc = (HDC)ptr.ToInt32 ();
SetStretchBltMode (dc, COLORONCOLOR);
StretchDIBits (dc, 0, 0, (int) (LabelPictureShow->Width), (int) (LabelPictureShow->Height), 0, 0, width, height, data, bitmapInfo, DIB_RGB_COLORS, SRCCOPY);    
 g->ReleaseHdc (ptr);

This way I draw whole videostream, one picture from stream after another, which works perfect. I have also function which resize my form and label over whole screen for realizing a full screen, wchich also works great when playing video.

But, when I stop the video or send only one picture and call the full scren function. It will not repaint the image and that's my problem. I tried to use Paint Event, Resize Event both of form and label for painting the image again after resizing, but nothing works. When I get fullscreen or back to normal size, my image flashes for short moment but then it's repainted by control's color and dissappears. I've tried to put the painting code with StretchDIBits everywhere both nothing works. Any help or advice is really appreciated.

edit:the sad thing for me is, that when i put the painting code in, for example, click event of label, it works fine...

Vladik
  • 1
  • 2

1 Answers1

0

Solved by using custom PaintBox control used in other project. This control uses overwritten OnPaint method where the image is redrawn. Somehow this solution works, but previous almost same solution not.

Vladik
  • 1
  • 2