Board index » cppbuilder » TImage flicker
Paul Dowd
![]() CBuilder Developer |
Paul Dowd
![]() CBuilder Developer |
TImage flicker2006-10-21 12:10:55 AM cppbuilder67 Hi, I have: void __fastcall TPreplot::ImageMouseMove(TObject *Sender, TShiftState Shift, int X, int Y) { if(Panning) { Image->Align = alNone; Image->Top += Y - OrigY; Image->Left += X - OrigX; return; } } when the image pans it flickers. How can I stop the flickering? Cheers, Paul |
Vladimir Stefanovic
![]() CBuilder Developer |
2006-10-21 12:28:37 AM
Re:TImage flickerQuotewhen the image pans it flickers. How can I stop the flickering? { // ... DoubleBuffered = true; // ... } -- Best Regards, Vladimir Stefanovic |
Paul Dowd
![]() CBuilder Developer |
2006-10-22 08:45:38 PM
Re:TImage flicker
this has no effect
Vladimir Stefanovic wrote: Quote>when the image pans it flickers. How can I stop the flickering? {smallsort} |
4N
![]() CBuilder Developer |
2006-10-23 12:28:38 AM
Re:TImage flicker
Try Image->Canvas->Brush->Style=bsClear
"Paul Dowd" < XXXX@XXXXX.COM >ha scritto nel messaggio Quotethis has no effect |
JD
![]() CBuilder Developer |
2006-10-23 12:49:30 AM
Re:TImage flicker
Paul Dowd < XXXX@XXXXX.COM >wrote:
Quote
QuoteHow can I stop the flickering? have the Stretched property set to true it's even slower. Since Window's can handle moving a large area without flicker, it has to be your technique. Please explain exactly what you're trying to accomplish. I'd bet that you can acomplish it with a TBitmap or two instead of using a TImage. ~ JD |
4N
![]() CBuilder Developer |
2006-10-23 02:07:17 AM
Re:TImage flicker
in place of setting Left and top with 2 different lines (=>2 different
calls) you can use Image->SetBounds ... I think "JD" < XXXX@XXXXX.COM >ha scritto nel messaggio Quote
|
Paul Dowd
![]() CBuilder Developer |
2006-10-23 06:33:08 AM
Re:TImage flicker
Hi all,
After trying your various suggestions I have come to the conclusion that the problem is just the refresh rate of the monitor. Many thanks Paul Paul Dowd wrote: QuoteHi, |
Paul Dowd
![]() CBuilder Developer |
2006-10-23 04:20:17 PM
Re:TImage flicker
Hi,
I actually posted a message saying that perhaps the problem was the screen refresh rate, this is not the case. I am trying to produce an image that can be zoomed in on by drawing a rectangle on it and then panned by dragging using the mouse, similar to, say, a PDF document. I have achieved all this but the flickering is still a problem. How could I do this using a TBitmap instead of a TImage? Paul Quote> |
JD
![]() CBuilder Developer |
2006-10-23 06:41:19 PM
Re:TImage flicker
Paul Dowd < XXXX@XXXXX.COM >wrote:
Quote
redraw. QuoteHow could I do this using a TBitmap instead of a TImage? the flicker, your code must eliminate the need to constantly repaint the image. The easiest way for you at this point is to use a second TImage that is transparent and overlays the other TImage exactly. Set it's Transparent property to true and fill it's Canvas with the same color (bottom/left pixel determines the transparent color). Should take you about 5 minutes to fix it. ~ JD |
4N
![]() CBuilder Developer |
2006-10-23 09:18:11 PM
Re:TImage flicker
No,
The problem likely is the internal invalidate. To get rid of it you should intercept the OnPaint event and draw the image using Canvas->Draw(x,y,Bitmap) without using Invalidate. "Paul Dowd" < XXXX@XXXXX.COM >ha scritto nel messaggio QuoteHi all, |
Harold Howe [TeamB]
![]() CBuilder Developer |
2006-10-24 04:04:54 AM
Re:TImage flicker
Paul Dowd wrote:
Quoteif(Panning) H^2 |
Paul Dowd
![]() CBuilder Developer |
2006-10-24 05:19:43 PM
Re:TImage flicker
Harold,
This article is great - problem solved! Many thanks, Paul Harold Howe [TeamB] wrote: QuotePaul Dowd wrote: |