tune
This commit is contained in:
+2
-9
@@ -90,8 +90,7 @@
|
||||
<p>This guide provides detailed implementation information for creating your own <code>RenderingCanvas</code> using the <a class="xref" href="../../../../../api/Hi.Disp.DispEngine.html">DispEngine</a>. By understanding these implementation details, you can customize the rendering component for specific application needs or create implementations for other UI frameworks.</p>
|
||||
<div class="NOTE">
|
||||
<h5>Note</h5>
|
||||
<p><strong>For Windows Applications</strong>: If you are developing for Windows systems, it is recommended to directly use the existing <code>RenderingCanvas</code> implementations in the <code>Hi.WinForm</code> or <code>Hi.Wpf</code> packages, rather than creating your own. These implementations are fully tested, optimized, and maintained.
|
||||
<strong>For Webapi Applications</strong>: Using <code>Hi.Webapi</code>.</p>
|
||||
<p><strong>For Windows Applications</strong>: If you are developing for Windows systems, it is recommended to directly use the existing <code>RenderingCanvas</code> implementations in the <code>Hi.WinForm</code> or <code>Hi.Wpf</code> packages, rather than creating your own. These implementations are fully tested, optimized, and maintained.</p>
|
||||
<p>The implementation details provided in this document are primarily for educational purposes or for developers who need to port RenderingCanvas to other platforms/frameworks.</p>
|
||||
</div>
|
||||
<h2 id="basic-dispengine-usage">Basic DispEngine Usage</h2>
|
||||
@@ -458,8 +457,7 @@ public RenderingCanvas()
|
||||
Content = DisplayerPane;
|
||||
}
|
||||
</code></pre><h3 id="rendering-pipeline-1">Rendering Pipeline</h3>
|
||||
<pre><code class="lang-csharp" name="RenderingCanvas">private byte[] PreImageBgra { get; set; }
|
||||
/// <summary>
|
||||
<pre><code class="lang-csharp" name="RenderingCanvas">/// <summary>
|
||||
/// Handles the buffer swapped event from DispEngine
|
||||
/// </summary>
|
||||
private unsafe void RenderingCanvas_BufferSwapped(byte* data, int w, int h)
|
||||
@@ -467,12 +465,7 @@ private unsafe void RenderingCanvas_BufferSwapped(byte* data, int w, int h)
|
||||
if (data == null)
|
||||
return;
|
||||
|
||||
//since the treatment is different from Razor version,
|
||||
//the image checking mechanism cannot be set in DispEngine.
|
||||
Span<byte> bgra = new Span<byte>(data, w * h * 4);
|
||||
if (PreImageBgra != null && bgra.SequenceEqual(PreImageBgra))
|
||||
return;
|
||||
PreImageBgra = bgra.ToArray();
|
||||
|
||||
// Copy pixel data from DispEngine
|
||||
int n = w * h * 4;
|
||||
|
||||
Reference in New Issue
Block a user