AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Object-Pascal / Delphi-Language Delphi How elimitnate flicker of Form on resizing?

How elimitnate flicker of Form on resizing?

Ein Thema von flashcoder · begonnen am 6. Feb 2018 · letzter Beitrag vom 9. Feb 2018
Antwort Antwort
EWeiss
(Gast)

n/a Beiträge
 
#1

AW: How elimitnate flicker of Form on resizing?

  Alt 6. Feb 2018, 17:31
Paint in Paint and ignore WMEraseBkgnd btw. result 1 and Exit.

greets
  Mit Zitat antworten Zitat
flashcoder

Registriert seit: 10. Nov 2013
83 Beiträge
 
#2

AW: How elimitnate flicker of Form on resizing?

  Alt 6. Feb 2018, 17:49
Paint in Paint and ignore WMEraseBkgnd btw. result 1 and Exit.

greets
Also without success, could show how you made, please?
  Mit Zitat antworten Zitat
EWeiss
(Gast)

n/a Beiträge
 
#3

AW: How elimitnate flicker of Form on resizing?

  Alt 6. Feb 2018, 18:24
using my Doublebuffer.
Delphi-Quellcode:
function TForm1.DoubleBuffer(DC: HDC; width, height: Integer; Action: TAction): HDC;
begin

  if Action = CreateBuffer then
  begin
    FDBufferhDCTemp := CreateCompatibleDC(DC);
    FDBufferhBMTemp := CreateCompatibleBitmap(DC, width, height);
    FDBufferhBMPrev := SelectObject(FDBufferhDCTemp, FDBufferhBMTemp);
    FDBufferXx := width;
    FDBufferYy := height;
    FDBufferUseDC := DC;
    Result := FDBufferhDCTemp;
  end
  else
  begin
    // Zeichne das Resultat ins Target Window
    BitBlt(FDBufferUseDC, width, height, FDBufferXx, FDBufferYy, FDBufferhDCTemp, 0, 0, SRCCOPY);
    // Befreie die system resourcen
    SelectObject(FDBufferhDCTemp, FDBufferhBMPrev);
    DeleteObject(FDBufferhBMTemp);
    DeleteDC(FDBufferhDCTemp);
    Result := 0;
  end;
end;
and load as example
how do use it. see PaintBox1Paint

i am not use Doublebuffer from the Form it self.

greets

Geändert von EWeiss ( 6. Feb 2018 um 18:27 Uhr)
  Mit Zitat antworten Zitat
flashcoder

Registriert seit: 10. Nov 2013
83 Beiträge
 
#4

AW: How elimitnate flicker of Form on resizing?

  Alt 6. Feb 2018, 18:40
Ok, but this way, Form will appear in screenshot, right?
  Mit Zitat antworten Zitat
EWeiss
(Gast)

n/a Beiträge
 
#5

AW: How elimitnate flicker of Form on resizing?

  Alt 6. Feb 2018, 18:44
Ok, but this way, Form will appear in screenshot, right?
why? read the example.
and then test it.

i am use D2010 so can't not use your example.. sorry

greets

Geändert von EWeiss ( 6. Feb 2018 um 18:48 Uhr)
  Mit Zitat antworten Zitat
flashcoder

Registriert seit: 10. Nov 2013
83 Beiträge
 
#6

AW: How elimitnate flicker of Form on resizing?

  Alt 6. Feb 2018, 18:56
Ok, but this way, Form will appear in screenshot, right?
why? read the example.
and then test it.

i am use D2010 so can't not use your example.. sorry

greets
All functions used in my example are compatible with any delphi version from 2010 until 10 Berlin
  Mit Zitat antworten Zitat
flashcoder

Registriert seit: 10. Nov 2013
83 Beiträge
 
#7

AW: How elimitnate flicker of Form on resizing?

  Alt 7. Feb 2018, 22:14
using my Doublebuffer.
Delphi-Quellcode:
function TForm1.DoubleBuffer(DC: HDC; width, height: Integer; Action: TAction): HDC;
begin

  if Action = CreateBuffer then
  begin
    FDBufferhDCTemp := CreateCompatibleDC(DC);
    FDBufferhBMTemp := CreateCompatibleBitmap(DC, width, height);
    FDBufferhBMPrev := SelectObject(FDBufferhDCTemp, FDBufferhBMTemp);
    FDBufferXx := width;
    FDBufferYy := height;
    FDBufferUseDC := DC;
    Result := FDBufferhDCTemp;
  end
  else
  begin
    // Zeichne das Resultat ins Target Window
    BitBlt(FDBufferUseDC, width, height, FDBufferXx, FDBufferYy, FDBufferhDCTemp, 0, 0, SRCCOPY);
    // Befreie die system resourcen
    SelectObject(FDBufferhDCTemp, FDBufferhBMPrev);
    DeleteObject(FDBufferhBMTemp);
    DeleteDC(FDBufferhDCTemp);
    Result := 0;
  end;
end;
and load as example
how do use it. see PaintBox1Paint

i am not use Doublebuffer from the Form it self.

greets


I not understood where use DC in my code

Delphi-Quellcode:
var
 DC: HDC;
 rc: TRect;
begin

rc := Form1.ClientRect;
DC := DoubleBuffer(Form1.Canvas.Handle, rc.Right, rc.Bottom, CreateBuffer);

// Where use this DC?

end;
and also want know if these parameters passed to this custom DoubleBuffer function are of my Form in my situation?
  Mit Zitat antworten Zitat
EWeiss
(Gast)

n/a Beiträge
 
#8

AW: How elimitnate flicker of Form on resizing?

  Alt 8. Feb 2018, 00:11
i can not see any resize Event in your example
after create the form in Fullscreen

so i not understand what your do.

greets
  Mit Zitat antworten Zitat
flashcoder

Registriert seit: 10. Nov 2013
83 Beiträge
 
#9

AW: How elimitnate flicker of Form on resizing?

  Alt 8. Feb 2018, 00:22
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?

Geändert von flashcoder ( 8. Feb 2018 um 00:26 Uhr)
  Mit Zitat antworten Zitat
EWeiss
(Gast)

n/a Beiträge
 
#10

AW: How elimitnate flicker of Form on resizing?

  Alt 8. Feb 2018, 00:24
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.

DesktopCanvas := TCanvas.Create; that should be
DesktopCanvas := DoubleBuffer(Form1.Canvas.Handle, rc.Right, rc.Bottom, CreateBuffer);
now draw to DesktopCanvas
..
then use
DoubleBuffer(0, 0, 0, DestroyBuffer);
which bitblt your result to the Target window and free the ressources.


greets

Geändert von EWeiss ( 8. Feb 2018 um 00:59 Uhr)
  Mit Zitat antworten Zitat
Antwort Antwort

Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 22:42 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz