Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi How elimitnate flicker of Form on resizing? (https://www.delphipraxis.net/195141-how-elimitnate-flicker-form-resizing.html)

EWeiss 8. Feb 2018 00:11

AW: How elimitnate flicker of Form on resizing?
 
i can not see any resize Event in your example
after create the form in Fullscreen

so i not understand what your do.

greets

flashcoder 8. Feb 2018 00:22

AW: How elimitnate flicker of Form on resizing?
 
Zitat:

Zitat von EWeiss (Beitrag 1393335)
i can not see any resize Event in your example
after create the form in Fullscreen

so i not understand what your do.

greets

The Form is resized inside of TakeScreenshot procedure.
Relative to my last answer, what component (in my case) i can apply custom DubleBuffer function?
Ex: the parameters received are of my Form? could give a example about where apply this function?

EWeiss 8. Feb 2018 00:24

AW: How elimitnate flicker of Form on resizing?
 
Zitat:

Zitat von flashcoder (Beitrag 1393336)
Zitat:

Zitat von EWeiss (Beitrag 1393335)
i can not see any resize Event in your example
after create the form in Fullscreen

so i not understand what your do.

greets

The Form is resized inside of TakeScreenshot procedure.

yes and then?
i see a Fullscreen without drawing any and after can't resize the form.
not understand how your see the flicker.. nothing is draw to the Fullscreen Window

sorry for my bad english.

Zitat:

Ex: the parameters received are of my Form? could give a example about where apply this function?
how?
if nothing paint on the fullcreen and i can not resize it.
and you has a example see my Starwars Scrolltext, please compare

if understand your code correctly then you create a CompatibleDC here.

Delphi-Quellcode:
DesktopCanvas := TCanvas.Create;
that should be
Delphi-Quellcode:
DesktopCanvas := DoubleBuffer(Form1.Canvas.Handle, rc.Right, rc.Bottom, CreateBuffer);

now draw to DesktopCanvas
..
then use
Delphi-Quellcode:
DoubleBuffer(0, 0, 0, DestroyBuffer);

which bitblt your result to the Target window and free the ressources.


greets

flashcoder 8. Feb 2018 01:08

AW: How elimitnate flicker of Form on resizing?
 
Unfortunately i not understood your custom DoubleBuffer function.
Probably this can work to remove flicker when Form is resized in TakeScreenshot method, but i'm totally lost about how implement on my code :(

EWeiss 8. Feb 2018 02:45

AW: How elimitnate flicker of Form on resizing?
 
Zitat:

Zitat von flashcoder (Beitrag 1393339)
Unfortunately i not understood your custom DoubleBuffer function.
Probably this can work to remove flicker when Form is resized in TakeScreenshot method, but i'm totally lost about how implement on my code :(

Delphi-Quellcode:
  if DoSnapShot then
  begin
    DoSnapShot := False;

    DesktopHwnd := GetDesktopWindow;
    DesktopDC := GetDC(DesktopHwnd);

    DesktopCanvas := DoubleBuffer(Canvas.Handle, ScreenRect.Right, ScreenRect.Bottom, CreateBuffer);
    BitBlt(DesktopCanvas, 0, 0, ScreenRect.Right, ScreenRect.Bottom, DesktopDC, 0, 0, SRCCOPY);
    DoubleBuffer(0, 0, 0, DestroyBuffer);

    ReleaseDc(DesktopHwnd, DesktopDC);
  end;
check this works by me..

EDIT:
Your problem is not the flickering but the setting of the height and width to 0
and then back to the old Position (Fullscreen)
Rethink your approach

using.. "Hide, Show" or "minimize, maximize" or create a Container for the Capture.
just a Suggestion.

greets

flashcoder 8. Feb 2018 15:15

AW: How elimitnate flicker of Form on resizing?
 
Zitat:

Zitat von EWeiss (Beitrag 1393341)

EDIT:
Your problem is not the flickering but the setting of the height and width to 0
and then back to the old Position (Fullscreen)
Rethink your approach

using.. "Hide, Show" or "minimize, maximize" or create a Container for the Capture.
just a Suggestion.

greets

@EWeiss,

this idea of container seems more appropiated for me, but my form still will appear on screenshot?
I not want hide/show or minimoze/maximize, this not is good. Remember that background of Form must be erased before capture the screen.
This container could be a TImage or what?

EWeiss 8. Feb 2018 23:07

AW: How elimitnate flicker of Form on resizing?
 
Zitat:

but my form still will appear on screenshot?
yes..

You change the size on every call that is wrong. (So you have to live with your current Situation)
You do not want to hide that windows, that's wrong. (so the form is still appear)

Unfortunately I can't help you anymore.. find your own way

greets

flashcoder 8. Feb 2018 23:54

AW: How elimitnate flicker of Form on resizing?
 
Zitat:

Zitat von EWeiss (Beitrag 1393410)
Zitat:

but my form still will appear on screenshot?
yes..

You change the size on every call that is wrong. (So you have to live with your current Situation)
You do not want to hide that windows, that's wrong. (so the form is still appear)

Unfortunately I can't help you anymore.. find your own way

greets

Ok, thank you very much by all your answers :-D

EWeiss 9. Feb 2018 00:16

AW: How elimitnate flicker of Form on resizing?
 
that works..
with my own way so you can see i have give you all required Information.
bye.

Anhang gelöscht.

greets


Alle Zeitangaben in WEZ +1. Es ist jetzt 02:26 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz