Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

TTabSheet Flickers

Posted on 2003-11-11
7
Medium Priority
?
727 Views
Last Modified: 2012-05-04
Hi everybody.

I have a form with a TPageControl that contains a TTabSheet with a TImage and a Timer that refreshes the TImage every 300 ms, and thats making the TImage flickers.  When I'm not using the TPageControl, placing the Image directly on the form the flicker did not happen. Does anybody knows how to stop the flicker inside the TTabSheet?

I've set the DoubleBuffered property from TForm, TPageControl and TTabSheet to true and nothing change.

Thanks ...
0
Comment
Question by:MauricioMaia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 8

Assisted Solution

by:gmayo
gmayo earned 200 total points
ID: 9724670
Why refresh the image? Does it change every 300ms? If not, why not check whether it has changed and only update it on screen only if it has changed?

Alternatively try a TPaintBox and StretchDraw your image onto that when required.

Geoff M.
0
 

Author Comment

by:MauricioMaia
ID: 9724757
Yeah, the image changes every 300ms.
I'm refreshing the image that comes from a capture board. And I use the canvas from TImage to select areas from the image (using canvas.rectangle and drawfocusrect), that will be used as reference to a motion detector.
0
 
LVL 8

Expert Comment

by:gmayo
ID: 9724819
So does it flicker every 300ms or more frequently?

Geoff M.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 1

Expert Comment

by:JackNaif
ID: 9725325
If the problem only occurs when all the stuff is in a TPage Control, then perhaps it comes from the TPageControl redrawing itself of from the handling of the "Hey, everybody, redraw now" messages between the TPageControl and its children.

Have you tried a using a TTabControl rather than a TPageControl? It's a bit more of work because you have to control when each component goes invisible or visible with your own code, but if you do it carefully you might get a better performance that will do the trick.

Hope it helps:

Jack
0
 

Author Comment

by:MauricioMaia
ID: 9730547

Geoff M., the flicker did not occurs every 300ms. It didn't have a constant frequency but occurs more frequently when the mouse pointer is  above the TImage.

Jack - With the TTabControl I get less flicker but It still have much enough to disturb the user interface.

Thanks.

Mauricio.
0
 
LVL 1

Accepted Solution

by:
JackNaif earned 200 total points
ID: 9731306
Then try this:

On an empty form put the image. Then put the TTabControl beside it. Now drag the image and place it over the TabControl. Now it is OVER the TTabControl. Not IN it.
It should be as good as putting it directly on the form (in fact it IS putting it right on the form).
(Be carefull, if you destroy the TabControl, the image won't get destroyed).

By way of example, here you have a form (with "View as Text") with a Button1 IN the TabControl and Button2 OVER it:

object Form1: TForm1
  Left = 192
  Top = 107
  Width = 696
  Height = 480
  Caption = 'Form1'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  object TabControl1: TTabControl
    Left = 200
    Top = 56
    Width = 289
    Height = 193
    TabOrder = 0
    Tabs.Strings = (
      'Tab1'
      'Tab2')
    TabIndex = 0
    object Button1: TButton
      Left = 104
      Top = 88
      Width = 75
      Height = 25
      Caption = 'Button1'
      TabOrder = 0
    end
  end
  object Button2: TButton
    Left = 304
    Top = 184
    Width = 75
    Height = 25
    Caption = 'Button2'
    TabOrder = 1
  end
end

It's an extremely dirty solution. In fact it's not a solution, it's just a work around, so if any other experts have more sugestions, my advise is to keep listening. But this might do the trick.

Regards:

Jack
0
 

Author Comment

by:MauricioMaia
ID: 9857684
I will split points between JackNaif and gmayo (His suggestion to use TPaintBot did work). Both found alternative ways to solve the problem. Thanks everybody for the help.
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question