PDA

Click to See Complete Forum and Search --> : Blank Picture box after Blitting


davidrobin
Dec 20th, 2001, 09:04 AM
I have a form with 2 picture boxes on.
PictureBox1 loads a bmp file on load, on click of a command button the BitBlt function blits picturebox1 picture to picturebox2. The image does not display until the refresh method is executed for picturebox2.

Picturebox2 has autoredraw set to true.

I don't want to have to refresh if possible, is there any way around this.

thanks;)

PsychoMark
Dec 20th, 2001, 09:35 AM
If you have AutoRedraw set to True, you have to call Refresh, otherwise, how would it know when you're done updating and the new image needs to be shown?

Why wouldn't you want refresh? It's a lot better than not using AutoRedraw and creating your own backbuffer, at least better in the sense of coding needed :)

davidrobin
Dec 20th, 2001, 10:27 AM
I am using the BitBlt in a dll I am writing, using Refresh means I know the destination object, As this could be a form or a picturebox or some other object I want my dll to work irrespective of the object.

For my dll to call refresh I have to know the objet otherwise I will have to rely on the programmer using the dll I am writing to call refresh on their chosen destination object.

(I know what I mean)

PsychoMark
Dec 20th, 2001, 11:42 AM
Passing the DC to the DLL I guess?


Well, you could try WindowFromDC, then UpdateWindow, maybe that'll force a Refresh. Otherwise, you could try using a backbuffer and set AutoRedraw to False...