Paint Above Controls

Posted on 2005-05-02
Last Modified: 2010-04-05
In my project I am trying to do a kind of transition effect. It goes like this:

1) Some controls are visible on the form
2) I capture an image of the form into a TBitmap
4) A timer paints the image onto the forms canvas every 10 milliseconds, making it slightly smaller each time (revealing more of the new contents of the form)
3) New controls are shown
4) The timer stops painting the image after it has done it 100 times

This works fine except for 2 things:

1) The form flickers a LOT. I have set the forms DoubleBuffered property to true but still it flickers...
2) The image is only painted above descendants of TGraphicControl. Other controls are still visible...

I need a way to solve both of these problems...
Question by:paulb1989
    LVL 5

    Author Comment

    Here is the code for the timer that paints on the form:

    procedure TfrmDesign.TransTimerTimer(Sender: TObject);

      if Steps <= TransSteps then
        TransTimer.Enabled := False;

        Canvas.CopyRect(Rect(0, 0, ClientWidth, ClientHeight - (Steps * (ClientHeight div TransSteps))), Pic.Canvas, ClientRect);

        TransTimer.Enabled := True;
      end else
        if Assigned(Pic) then
        TransTimer.Enabled := False;
    LVL 17

    Accepted Solution

    You can put this image on a panel and this panel on top of You form

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
    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…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    This video discusses moving either the default database or any database to a new volume.

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now