2023年9月13日 星期三

flashing flickering Canvas Blinking delphi

 

Double Buffering is one way but not always sufficient. Imagine you paint a shape at runtime, it depends on your repaint method. Forces the control to repaint its image on the screen could be crucial.

Call Repaint to force the control to repaint its image immediately. If the ControlStyle property includes csOpaque, the control paints itself directly. So double buffering plus invalidate and [csOpaque] as controlstyle could be an improvement:

var Compass: TPaintBox;
procedure TForm1ForceRepaint(Sender: TObject);
{Called when display type or compass angle changes}
begin
  compass.controlstyle:= [csOpaque];
  while heading.value<0 do heading.Value:=heading.Value+360;
  while heading.value>360 do heading.Value:=heading.Value-360;
  compass.Invalidate;
end;
https://stackoverflow.com/questions/1954491/stop-flickering

https://delphi-bar.blogspot.com/2012/11/prevent-screen-refresh-and-flickering.html
LockWindowUpdate(Handle);
try
    // Code goes here
finally
    LockWindowUpdate(0);
end;

Solution 2

SendMessage(Handle, WM_SETREDRAW, WPARAM(False), 0);
try
     // Code goes here
finally
    SendMessage(Handle, WM_SETREDRAW, WPARAM(True), 0);
    RedrawWindow(Self.Handle, nil, 0, RDW_ERASE or RDW_FRAME or RDW_INVALIDATE or RDW_ALLCHILDREN);
end;
https://delphi-bar.blogspot.com/2012/11/prevent-screen-refresh-and-flickering.html

https://stackoverflow.com/questions/15308077/delphi-custom-animation-collision-detection

 

https://www.codeproject.com/Articles/33/Flicker-Free-Drawing-In-MFC
https://stackoverflow.com/questions/6363954/best-way-to-do-non-flickering-segmented-graphics-updates-in-delphi
https://stackoverflow.com/questions/17483147/flicker-does-not-reduce-after-double-buffering-in-mfc-cpaintdc
https://stackoverflow.com/questions/17483147/flicker-does-not-reduce-after-double-buffering-in-mfc-cpaintdc

winui 3 roadmap microsoft foundation class library (mfc) informs windows presentation foundation (wpf) universal windows platform uwp vector draw canvas resize dot codeproject UWP UIElement Resizable DrawEllipse RectTracker Stretch Handle Runtime Designer UWP Shape Resizing

 

  microsoft foundation class library (mfc)
 MFC, OO framework for Native C++.
 WinForms, .NET Framework.
WPF, .NET Framework. WinForms.

universal windows platform
UWP XAML (for Windows 8), Metro/Store apps, C++ & .NET.
MFC, WinForms, WPF are Desktop (Win32) Apps.

WinUI Windows UI Library.
WinUI 2 UWP Apps.
WinUI 3 combines UWP XAML
 WinUI 2

WebView2. WinUI 3
WinUI 3 with .NET 5.
Microsoft.WinUI NuGet package.
NET Desktop WinUI 3 app

WebView2
Fluent Design System
React Native

https://github.com/microsoft/Windows-universal-samples/tree/main/Samples/OCR

 winui 3  microsoft foundation class library histroy
 https://www.grapecity.com/blogs/comparing-winui-and-its-predecessors
 https://mariusbancila.ro/blog/2022/04/08/unwrapping-winui3-for-cpp/
 https://www.tardistech.com/2020/05/20/everything-you-need-to-know-about-winui/
 https://learn.microsoft.com/en-us/dotnet/maui/what-is-maui

windows presentation foundation universal windows platform
https://learn.microsoft.com/zh-tw/dotnet/architecture/modernize-desktop/why-modern-applications
UWP

https://learn.microsoft.com/en-us/windows/apps/design/controls/shapes
https://digitalerr0r.net/category/uwp/
https://www.c-sharpcorner.com/UploadFile/0cb003/relative-panel-controls-in-universal-app-platform/
https://docs.telerik.com/devtools/wpf/controls/raddiagram/items-manipulation/raddiagrams-features-resizing
https://stackoverflow.com/questions/59965679/keeping-adorner-glyphs-on-top-for-selected-control-in-winforms-designer
https://www.c-sharpcorner.com/UploadFile/0cb003/relative-panel-controls-in-universal-app-platform/

https://stackoverflow.com/questions/41616288/c-sharp-uwp-universal-windows-app-shape-resizing
https://learn.microsoft.com/en-us/dotnet/desktop/wpf/controls/adorners-overview?view=netframeworkdesktop-4.8&redirectedfrom=MSDN

Resizing Controls at run time
delphi runtime design library
delphi runtime library

MFC
CRectTracker
Resizing Controls at run time
http://www.codeproject.com/Articles/7771/Limit-CRectTracker-handles
http://www.codeproject.com/Articles/856/Resizing-Controls-at-run-time


TStretchHandle
http://www.torry.net/quicksearchd.php?String=tstretchhandle&Title=Yes
http://delphimaster.net/view/4-1125138258/all

Inicio > Componentes    > Componente TSelectOnRuntimeComponente TSelectOnRuntime
http://neftali.clubdelphi.com/?p=269

The Runtime Design System Suite By Kazuhiro Sasaki.
http://users.utcluj.ro/~ciplea/delphi/componente/objectinspectors.html
Runtime Design System v.2.2 FWS 1051 Kb 27 May 1999
By Kazuhiro Sasaki. At runtime, your application users can do Moving Controls, Resizeing Controls, Deleting Controls, Creating Controls, Changing Property in the Object Inspector, Saving Controls and Loading Controls if you use the Runtime Design System. Moreover, you hardly need to do programming.
Fully functional
Source: Included
Exe-demo included
Download: D3 D4
http://www.torry.net/quicksearchd.php?String=Runtime+Design&Title=Yes


Runtime Designer Component. called TSelectOnRuntime of Neftali (ClubDelphi.com) works on Lazarus
TSelectOnRuntime Lazarus


Using Delphi and Python together
Talk for the Australian Delphi User Group (ADUG), July and August 2001
-Andy Bulka
abulka@netspace.net.au
http://www.atug.com/andypatterns/pythonDelphiTalk.htm

 simple Python evaluator Python/Delphi synchronization
TPythonGUIInputOutput TRichEdit Execute script

CRectTracker

border Resizable DrawEllipse RectTracker Stretch Handle Runtime Resizing

https://www.codeproject.com/Articles/24096/Drawing-Resizable-Controls-at-Runtime
https://learn.microsoft.com/en-us/dotnet/desktop/wpf/controls/adorners-overview?view=netframeworkdesktop-4.8&redirectedfrom=MSDN
Adding functional handles to a UIElement that enable a user to manipulate the element in some way (resize, rotate, reposition, etc.).
    drawingContext.DrawEllipse(renderBrush, renderPen, adornedElementRect.TopLeft, renderRadius, renderRadius);

codeproject  UWP UIElement Resizable DrawEllipse  RectTracker Stretch Handle Runtime Designer   UWP Shape Resizing
uwp vector draw  canvas resize dot codeproject  UWP UIElement Resizable DrawEllipse  RectTracker Stretch Handle Runtime Designer   UWP Shape Resizing

https://stackoverflow.com/questions/22257408/user-resizable-and-user-rotatable-shapes-on-canvas-with-wpf
https://stackoverflow.com/questions/10198381/resizing-a-rectangle-while-dragging-on-windows-form
https://stackoverflow.com/questions/48161997/resize-drawn-rectangle-using-mvvm-wpf https://learn.microsoft.com/en-us/answers/questions/276622/move-resize-(dynamically-created)-rectangle-with-m
https://learn.microsoft.com/zh-tw/windows/uwp/composition/visual-layer
Windows Composition  Windows.UI.Composition   Windows.UI.Xaml
https://blogs.windows.com/windowsdeveloper/2015/12/08/awaken-your-creativity-with-the-new-windows-ui-composition/

uwp runtime create Resizable border DrawEllipse Tracker Stretch Handle Runtime Resizing  corner

uwp runtime create Resizable border  Runtime  dynamically created
https://github.com/microsoft/Win2D/blob/winappsdk/main/CHANGELOG.md
https://www.codeproject.com/Articles/139930/A-simple-trick-to-resize-a-control-at-runtime
https://github.com/microsoft/microsoft-ui-xaml
https://github.com/microsoft/WinUI-Gallery
win2d example gallery.winui 3 ArcOptions Example github


 https://learn.microsoft.com/en-us/windows/uwp/winrt-components/creating-windows-runtime-components-in-csharp-and-visual-basic