-
- Active Member
- Posts: 40
- Joined: 23 Sep 2002 23:01
Expand a picture without flickering with 7.4
Hi,
I joined two projects (the second in the next post) . One is build with VIP 7.4, the other one with VIP 7.3.
The purpose of the projects is to expand the same picture.
One can see that the expansion with 7.3 is perfect, when the expansion with 7.4 displays an unpleasant flickering. The code is fast the same one : the 7.3 project uses the gdiPlus predicates, the 7.4 the image and graphics ones.
Is there a way to avoid such a flickering ?
I noted the same effect when resizing the window displaying classes in the 7.4 project : may be is it connected to the use of scintilla ?
I joined two projects (the second in the next post) . One is build with VIP 7.4, the other one with VIP 7.3.
The purpose of the projects is to expand the same picture.
One can see that the expansion with 7.3 is perfect, when the expansion with 7.4 displays an unpleasant flickering. The code is fast the same one : the 7.3 project uses the gdiPlus predicates, the 7.4 the image and graphics ones.
Is there a way to avoid such a flickering ?
I noted the same effect when resizing the window displaying classes in the 7.4 project : may be is it connected to the use of scintilla ?
- Attachments
-
- ExpandPict 7.4.zip
- (36.99 KiB) Downloaded 693 times
Regards
Dominique Pannier
Dominique Pannier
-
- Active Member
- Posts: 40
- Joined: 23 Sep 2002 23:01
The second project.
- Attachments
-
- ExpandPict 7.3.zip
- (37.52 KiB) Downloaded 641 times
Regards
Dominique Pannier
Dominique Pannier
-
- Active Member
- Posts: 37
- Joined: 4 Mar 2000 0:01
- Thomas Linder Puls
- VIP Member
- Posts: 1418
- Joined: 28 Feb 2000 0:01
Hi, Dominique.
I can reproduce the problem.
You forgot to include the png-file, but I used another. However, I noticed that the 74 program raised an exception when the png was missing, the 73 program did not.
We will look at the problem.
It has nothing to do with the scintilla (removing it from your program has no effect.
I can reproduce the problem.
You forgot to include the png-file, but I used another. However, I noticed that the 74 program raised an exception when the png was missing, the 73 program did not.
We will look at the problem.
It has nothing to do with the scintilla (removing it from your program has no effect.
Regards Thomas Linder Puls
PDC
PDC
-
- Active Member
- Posts: 40
- Joined: 23 Sep 2002 23:01
-
- Active Member
- Posts: 40
- Joined: 23 Sep 2002 23:01
- Thomas Linder Puls
- VIP Member
- Posts: 1418
- Joined: 28 Feb 2000 0:01
I am sorry that I forgot to return on this issue.
In brief:
The Vip 7.3 behavior can be achieved in 7.4 and 7.5 by setting an eraseBackgroundResponder. In Vip7.5 it can look like this:
Actually, the behavior is only nearly the same, because now the background is never erazed, which leaves it white rather than gray. So to get the exact same behavior it is necessary either to erase it the first time:
.
Or to draw to paint the correct color in the entire area when the control is initially created (but that is much more difficult than the solution above).
Or to draw in the entire area (this is often the approach when using an image to create double buffering).
In brief:
- Vip 7.3 is bogus
- Vip 7.4 and 7.5 are correct
- In Vip 7.3: the update is smooth, because the images are just drawn never erased. After expansion the dialog contains two copies of the image. If the image was deflated instead of expanded, the dialog would end with remains of many copies of the image.
- In Vip7.4 and 7.5 the update flickers, but there is no remains of previous drawings.
The Vip 7.3 behavior can be achieved in 7.4 and 7.5 by setting an eraseBackgroundResponder. In Vip7.5 it can look like this:
Code: Select all
implement imageSup
inherits userControlSupport
open core, vpiDomains, image
...
clauses
new():-
generatedInitialize(),
setEraseBackgroundResponder({ = noEraseBackground }).
Code: Select all
clauses
new():-
generatedInitialize(),
First = varM::new(true),
setEraseBackgroundResponder({ = E :-
if true = First:value then
First:value := false,
E = eraseBackground
else
E = noEraseBackground end if
})
Or to draw to paint the correct color in the entire area when the control is initially created (but that is much more difficult than the solution above).
Or to draw in the entire area (this is often the approach when using an image to create double buffering).
Regards Thomas Linder Puls
PDC
PDC
-
- Active Member
- Posts: 40
- Joined: 23 Sep 2002 23:01
-
- Active Member
- Posts: 40
- Joined: 23 Sep 2002 23:01
setEraseBackgroundResponder is running fine.
But care must be taken if other windows are displayed: the action of this responder is not limited to the window in which it is used : when using simultaneously a tooltip window, for instance, when this one is moved it's not completely erased (the border is not removed) if the response was noEraseBackground.
So I'm using setEraseBackgroundResponder before expanding the images, (before launching the timer). And after the expansion (when the timer will be killed), I use the predicate resetEraseBackgroundResponder.
And then the behavior of other windows is totally normal.![Cool 8-)](./images/smilies/icon_cool.gif)
But care must be taken if other windows are displayed: the action of this responder is not limited to the window in which it is used : when using simultaneously a tooltip window, for instance, when this one is moved it's not completely erased (the border is not removed) if the response was noEraseBackground.
So I'm using setEraseBackgroundResponder before expanding the images, (before launching the timer). And after the expansion (when the timer will be killed), I use the predicate resetEraseBackgroundResponder.
And then the behavior of other windows is totally normal.
![Cool 8-)](./images/smilies/icon_cool.gif)
Regards
Dominique Pannier
Dominique Pannier