Le 13 sept. 11 à 14:29, Christian Schmitz a écrit: > Am 13.09.2011 um 13:56 schrieb Arnaud Nicolet: > >> Ok, so in my paint event, I have a CGContext (this is the only >> place). >> If I want to call its flush method, I first have to use self.refresh >> (to invoke the paint event) and let it call the flush method? This >> sounds weird to me, because it'd call refresh prior to flush. > > In the paint event, you normally are not allowed to call refresh. > And flush doesn't help there normally, as there is an explicit flush.
I wouldn't call refresh from the paint event of course. I'm guessing my original question isn't clear. Ok, trying again. I have two methods, basically: 1: one where I set transparency and define the picture and shape (transparency is set only once, of course) 2: the paint event of the window Now, I can use method 1 to change the shape dynamically (I pass another picture and mask and the window changes its shape). Problem: the window's shadow isn't updated (the old mask is still used). If I hide/show the window or switch back and forth to my application, the shadow is corrected (but I want to do it automatically). For this, InvalidateShadowMBS seems to be the answer, but, used alone, it doesn't work. And your documentation says this: <quote>For best performance and visual appearance, you should follow these steps when invalidating a window shadow: disable updates with DisableScreenUpdatesMBS, draw, flush, invalidate the shadow, and enable updates.</quote>. So, my code (method 1) currently does this, according to the steps quoted above: DisableScreenUpdatesMBS (disable updates) Create the CGImage (draw) ??? (flush) self.InvalidateShadowMBS (invalidate the shadow) EnableScreenUpdatesMBS (enable updates) (in parenthesis, each step from the quoted documentation, to make it clear). But I have no idea how I can do the "flush" step. The only flush method is the one of the CGContext object found in the paint event, but it's not callable from method 1. Self.refresh, self.UpdateNow and self.UpdateNowMBS don't do the flush either. Please tell me if it's still not clear and I'll post the methods. _______________________________________________ Mbsplugins_monkeybreadsoftware.info mailing list [email protected] https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info
