Re: [lazarus] Reducing Flickeron a TImage component

2007-05-31 Thread A.J. Venter
The disabled TBitBtn flickers, because the grayed image is created during paint. TSpeedButton does not gray the image, but paints delayed (gtk1 intf). So it might flicker less for small buttons. Aaaah, okay, that explains it - but also means it won't work for me. The 'grayed' effect is fairly

Re: [lazarus] Reducing Flickeron a TImage component

2007-05-31 Thread Mattias Gaertner
On Thu, 31 May 2007 09:14:52 +0200 A.J. Venter [EMAIL PROTECTED] wrote: The disabled TBitBtn flickers, because the grayed image is created during paint. TSpeedButton does not gray the image, but paints delayed (gtk1 intf). So it might flicker less for small buttons. Aaaah, okay, that

Re: [lazarus] Reducing Flickeron a TImage component

2007-05-30 Thread A.J. Venter
It seems, gtk_pixmap is creating the disabled image on-the-fly on first paint. So, the flickering is built-in. Because you change the image often, you see it often. Conclusion: gtk1+TBitBtn+disabled = flicker So the short version is - that GTK1 couldn't do what I needed (a dynamically updated

Re: [lazarus] Reducing Flickeron a TImage component

2007-05-30 Thread Mattias Gaertner
On Wed, 30 May 2007 10:34:45 +0200 A.J. Venter [EMAIL PROTECTED] wrote: It seems, gtk_pixmap is creating the disabled image on-the-fly on first paint. So, the flickering is built-in. Because you change the image often, you see it often. Conclusion: gtk1+TBitBtn+disabled = flicker So

Re: [lazarus] Reducing Flickeron a TImage component

2007-05-30 Thread A.J. Venter
gtk1+TBitBtn+disabled = flicker So the short version is - that GTK1 couldn't do what I needed (a dynamically updated but often disabled set of buttons with pictures on them) without creating a new component. Maybe you can try TSpeedButton instead of TBitBtn. That would only work if I

Re: [lazarus] Reducing Flickeron a TImage component

2007-05-30 Thread Mattias Gaertner
On Wed, 30 May 2007 13:56:55 +0200 A.J. Venter [EMAIL PROTECTED] wrote: gtk1+TBitBtn+disabled = flicker So the short version is - that GTK1 couldn't do what I needed (a dynamically updated but often disabled set of buttons with pictures on them) without creating a new component.

Re: [lazarus] Reducing Flickeron a TImage component

2007-05-30 Thread A.J. Venter
Maybe you can try TSpeedButton instead of TBitBtn. That would only work if I painted the Caption myself would it not ? TSpeedButton has a Caption. Default is ''. In which case... it gets even MORE custom painting... not sure it's worth it. Did you try? Heh, point made :) Question then:

Re: [lazarus] Reducing Flickeron a TImage component

2007-05-30 Thread Mattias Gaertner
On Wed, 30 May 2007 22:17:57 +0200 A.J. Venter [EMAIL PROTECTED] wrote: Maybe you can try TSpeedButton instead of TBitBtn. That would only work if I painted the Caption myself would it not ? TSpeedButton has a Caption. Default is ''. In which case... it gets even MORE

Re: [lazarus] Reducing Flickeron a TImage component

2007-05-29 Thread A.J. Venter
An updated (related) question would be whether there is any way to remove the flicker in THIS case: I have a couple of TBitBtn components. Appart from their captions and glyphs, I actually write some information to the canvasses which are meant to show up ON TOP of each glyph. A button may or

Re: [lazarus] Reducing Flickeron a TImage component

2007-05-29 Thread A.J. Venter
On 5/29/07, Felipe Monteiro de Carvalho [EMAIL PROTECTED] wrote: On 5/29/07, A.J. Venter [EMAIL PROTECTED] wrote: I have a couple of TBitBtn components. Appart from their captions and glyphs, I actually write some information to the canvasses which are meant to show up ON TOP of each glyph.

Re: [lazarus] Reducing Flickeron a TImage component

2007-05-29 Thread Dave Coventry
AJ, In my case, when the image is redrawn, the TImage was cleared which showed the underlying colour (clBtnFace), which caused the flicker when the black background was painted in. I'm not sure of how relevant it would be in your case, but I changed the colour of the underlying panel to

Re: [lazarus] Reducing Flickeron a TImage component

2007-05-29 Thread A.J. Venter
Well I've reduced the flicker a little by doing a few small things (mostly not reloading images unless they have changed). I also set the DoubleBuffered property of the components to true, though I see no effect from doing so nor do I know what effect it's supposed to have. My understanding of

Re: [lazarus] Reducing Flickeron a TImage component

2007-05-29 Thread Mattias Gaertner
On Tue, 29 May 2007 11:26:02 +0200 A.J. Venter [EMAIL PROTECTED] wrote: Well I've reduced the flicker a little by doing a few small things (mostly not reloading images unless they have changed). I also set the DoubleBuffered property of the components to true, though I see no effect from

Re: [lazarus] Reducing Flickeron a TImage component

2007-05-29 Thread A.J. Venter
DoubleBuffered is a hint for the interface. The gtk2 intf always paints double buffered for each gdkwindow. That means paint events are double buffered, other painting not. The gtk1 intf has almost no doublebuffering. I'm not sure about the other interfaces. Aaah okay, that makes sense. I only

Re: [lazarus] Reducing Flickeron a TImage component

2007-05-29 Thread Charl van Jaarsveldt
Hi, I am just making a wild guess, so if it sounds absurd, please ignore. :-) How about creating a dummy invisible button, and use that one as a buffer for all the other buttons. So, everytime you need to update a button, rather make the dummy what you want, then somehow copy the canvas of the

Re: [lazarus] Reducing Flickeron a TImage component

2007-05-29 Thread Mattias Gärtner
Zitat von A.J. Venter [EMAIL PROTECTED]: DoubleBuffered is a hint for the interface. The gtk2 intf always paints double buffered for each gdkwindow. That means paint events are double buffered, other painting not. The gtk1 intf has almost no doublebuffering. I'm not sure about the other

Re: [lazarus] Reducing Flickeron a TImage component

2007-05-29 Thread Darmawan Sugiarto
I used TPaintBox... it's work better than Timage when Drawing (OnPaint) You can try it Gustavo Enrique Jimenez [EMAIL PROTECTED] wrote: 2007/5/28, Dave Coventry [EMAIL PROTECTED]: Gustavo Enrique Jimenez wrote: There are good tutorials/examples on

Re: [lazarus] Reducing Flickeron a TImage component

2007-05-29 Thread Mattias Gaertner
On Tue, 29 May 2007 15:11:48 +0200 Mattias Gärtner [EMAIL PROTECTED] wrote: Zitat von A.J. Venter [EMAIL PROTECTED]: DoubleBuffered is a hint for the interface. The gtk2 intf always paints double buffered for each gdkwindow. That means paint events are double buffered, other painting

[lazarus] Reducing Flickeron a TImage component

2007-05-28 Thread Dave Coventry
I'm getting an awful lot of screen flicker from the following code: == snip Form1.Image1.Canvas.Pen.Color:=$FF; Form1.Image1.Canvas.Pen.Mode:=pmNot; Form1.Image1.Canvas.MoveTo(iCornerX,CornerY); Form1.Image1.Canvas.LineTo(PrevX,PrevY);

Re: [lazarus] Reducing Flickeron a TImage component

2007-05-28 Thread Gustavo Enrique Jimenez
Hi I'm getting an awful lot of screen flicker from the following code: == snip Form1.Image1.Canvas.Pen.Color:=$FF; Form1.Image1.Canvas.Pen.Mode:=pmNot; Form1.Image1.Canvas.MoveTo(iCornerX,CornerY);

Re: [lazarus] Reducing Flickeron a TImage component

2007-05-28 Thread Dave Coventry
Gustavo Enrique Jimenez wrote: There are good tutorials/examples on http://wiki.lazarus.freepascal.org/Developing_with_Graphics http://wiki.lazarus.freepascal.org/Developing_with_Graphics Gustavo, Thank you for your reply. But they don't really help. Do you draw a line to the

Re: [lazarus] Reducing Flickeron a TImage component

2007-05-28 Thread Gustavo Enrique Jimenez
2007/5/28, Dave Coventry [EMAIL PROTECTED]: Gustavo Enrique Jimenez wrote: There are good tutorials/examples on http://wiki.lazarus.freepascal.org/Developing_with_Graphics http://wiki.lazarus.freepascal.org/Developing_with_Graphics Gustavo, Thank you for your reply. But they don't really

Re: [lazarus] Reducing Flickeron a TImage component

2007-05-28 Thread Felipe Monteiro de Carvalho
On 5/28/07, Gustavo Enrique Jimenez [EMAIL PROTECTED] wrote: ps: for the record, Felipe Monteiro help me A LOT in private mails. Thanks Felipe, and excuse me for bother you in private. No problem =) -- Felipe Monteiro de Carvalho

Re: [lazarus] Reducing Flickeron a TImage component

2007-05-28 Thread Dave Coventry
Gustavo, My problem was caused by the fact that the background for my TImage was black. When I placed it on a black-coloured panel (I used a TScrollBox as I want to capture mousewheel events), I found the flicker was more or less unoticeable. Gustavo Enrique Jimenez wrote: 2007/5/28,