Search

CN-121996186-A - MFC-based local refreshing and cache collaborative drawing refreshing method

CN121996186ACN 121996186 ACN121996186 ACN 121996186ACN-121996186-A

Abstract

The invention discloses a local refreshing and cache collaborative drawing refreshing method based on an MFC (micro-computer memory), which specifically comprises the steps of recording element changes based on a state monitoring mechanism of picture elements, automatically identifying the change elements and related elements thereof when users interact or data change, generating a picture change region, carrying out coordinate conversion, overlapping merging and visual range clipping on the change region according to the original display range of the change elements, the scaling and rolling offset of a current view to obtain a minimized refreshing range, sequentially executing redrawing in the refreshing range, maintaining a local cache bitmap for the visual region by using a graphic operator, carrying out cache updating on only a failure region based on the mapping relation of screen coordinates and cache coordinates, directly multiplexing and caching the failure region, carrying out differential failure marking on the corresponding local cache region when the elements move, attributes modify, roll, scale or resolution change, and realizing cache reconstruction by combining redrawing and cache scaling.

Inventors

  • Zhou Honglv
  • OU XINMU
  • FU CHUNQI
  • XU SHAOHUI
  • NIE HUAXING
  • ZENG ZHENZHEN
  • Wang Shituan
  • ZHANG HUABIN

Assignees

  • 福建富昌维控电子科技股份有限公司

Dates

Publication Date
20260508
Application Date
20251215

Claims (10)

  1. 1. The high-resolution multi-element local refreshing and cache collaborative drawing refreshing method based on the MFC is characterized by comprising the following steps of: S1, based on a state monitoring mechanism of picture elements, recording position, size, type and attribute changes of the elements, automatically identifying the changed elements and associated elements thereof when user interaction or data change, and generating a picture change area; s2, carrying out coordinate conversion, overlapping combination and visual range cutting on the change area according to the original display range of the change element, the scaling and rolling offset of the current view to obtain a minimized refreshing range; s3, redrawing is carried out in the refreshing range according to the sequence of the background layer, the element layer and the state identification layer; s4, maintaining a local cache bitmap for the visual area by using a graphic operator, and based on the mapping relation between the screen coordinates and the cache coordinates, only updating the cache of the invalid area, wherein the cache is directly multiplexed by the non-invalid area; And S5, when the element moves, the attribute modifies, scrolls, scales or the resolution changes, performing differential invalidation marking on the corresponding local cache region, and realizing cache reconstruction through combination of redrawing and cache scaling.
  2. 2. The local refreshing and cache collaborative drawing refreshing method according to claim 1, wherein the automatic identification of the change element and the associated elements thereof specifically further comprises traversing all elements in a view, obtaining a display range of a current element and other elements, and adding the intersected element as an associated element into an associated element set if a rectangular display area of the current element and the other elements are intersected, wherein the element display range is obtained through an element range obtaining function, and intersection judgment is completed through a rectangular area intersection detection function.
  3. 3. The partial refresh and cache collaborative drawing refresh method according to claim 1, wherein the identification of the picture change area obtains a user behavior operation through an event capturing mechanism, and calculates the change area based on position information of elements before and after the operation and an offset amount.
  4. 4. The partial refresh and cache co-drawing refresh method of claim 1, wherein the refresh range calculation includes coordinate conversion of original boundary coordinates of the change element according to a view scaling to generate an actual display range consistent with the current view.
  5. 5. The partial refresh and cache collaborative drawing refresh method according to claim 1, wherein the refresh range calculation corrects coordinates according to view scroll offset to determine whether an element enters a current viewable area, thereby redrawing only an area within the viewable range.
  6. 6. The partial refresh and cache co-drawing refresh method of claim 1, wherein the partial cache bitmap is maintained by a graphics operator, the graphics operator internally comprising a cache bitmap data structure and a cache update entry for recording and updating cache contents of the viewable area.
  7. 7. The partial refresh and cache collaborative drawing refresh method according to claim 1, wherein screen coordinates are converted into logical coordinates in a scaling operation by a mapping relation between the screen coordinates and cache coordinates, thereby ensuring that a cache update range is consistent with an actual change range.
  8. 8. The method for collaborative drawing refreshing with local refreshing and buffering according to claim 1, wherein when the visual range is enlarged due to scaling of the picture, the newly appeared annular rectangular area is marked as a dead area and the buffering is generated by redrawing, and the original buffering of the reduced area is readjusted according to the scaling ratio and then a new buffering bitmap is synthesized with the redrawing area.
  9. 9. The method for refreshing a collaborative drawing by local refreshing and caching according to claim 1, wherein the differential invalidation flag specifically further comprises converting a dirty region rectangle based on screen coordinates into a cached dirty region rectangle under a cached coordinate system through view scaling, traversing an existing dirty region list in a layer cached object, skipping an adding operation if any existing dirty region is identical in coordinates and size with the cached dirty region, adding the cached dirty region into the dirty region list if the same dirty region does not exist, and setting an update flag bit of the cached object to be updated to indicate the local region of the cache to be rebuilt.
  10. 10. A computer program product, characterized in that it has stored thereon a computer program which, when executed by a processor, implements the method according to any of claims 1-9.

Description

MFC-based local refreshing and cache collaborative drawing refreshing method Technical Field The invention relates to the technical field of drawing of an interactive interface of an embedded equipment terminal, in particular to a local refreshing and cache collaborative drawing refreshing method based on an MFC. Background Most of the drawing schemes in the market meet the use scene of a user under the conventional condition, but the use range is limited, and the user is easy to get stuck in a scene with large resolution, and the reason is as follows: 1) The interaction response is lagged, the prior art adopts full-picture redrawing, when more complex elements of pictures are displayed, picture information change occurs, and the picture information is blocked and updated untimely, so that obvious interaction delay sense is caused. 2) The lack of fine drawing cache management repeatedly draws unchanged elements, and repeatedly draws unchanged areas each time when callback causes excessive load of CPU, insufficient memory bandwidth and increases unnecessary memory overhead. 3) The picture drawing area lacks accurate calculation, and the prior art can not draw the area together when drawing the picture, so that serious drawing resource waste is caused. Disclosure of Invention The picture refreshing mechanism is an interface drawing mechanism, and is widely applied to the core fields of industrial automatic monitoring systems, embedded equipment interaction interfaces, SCADA systems, graphic configuration software and the like, and the scenes generally have the requirements of dense picture elements, real-time data updating, multi-element collaborative updating and the like. According to a first aspect of the present invention, a method for refreshing a local refresh and a cache collaborative drawing based on MFC high-resolution multi-element is provided, which specifically includes: S1, based on a state monitoring mechanism of picture elements, recording position, size, type and attribute changes of the elements, automatically identifying the changed elements and associated elements thereof when user interaction or data change, and generating a picture change area; s2, carrying out coordinate conversion, overlapping combination and visual range cutting on the change area according to the original display range of the change element, the scaling and rolling offset of the current view to obtain a minimized refreshing range; s3, redrawing is carried out in the refreshing range according to the sequence of the background layer, the element layer and the state identification layer; s4, maintaining a local cache bitmap for the visual area by the graphic operator, and based on the mapping relation between the screen coordinates and the cache coordinates, only updating the cache of the invalid area, wherein the cache is directly multiplexed by the non-invalid area; And S5, when the element moves, the attribute modifies, scrolls, scales or the resolution changes, performing differential invalidation marking on the corresponding local cache region, and realizing cache reconstruction through combination of redrawing and cache scaling. The method comprises the steps of realizing the remarkable reduction of the refreshing range and redrawing times of a picture by a combined mechanism of region identification, minimum range refreshing and differential cache updating, thereby improving the rendering efficiency of an interface. S1, based on a state monitoring mechanism of picture elements, recording position, size, type and attribute changes of the elements, automatically identifying the changed elements and associated elements thereof when user interaction or data change, and generating a picture change area; s2, carrying out coordinate conversion, overlapping combination and visual range cutting on the change area according to the original display range of the change element, the scaling and rolling offset of the current view to obtain a minimized refreshing range; s3, redrawing is carried out in the refreshing range according to the sequence of the background layer, the element layer and the state identification layer; s4, maintaining a local cache bitmap for the visual area by using a graphic operator, and based on the mapping relation between the screen coordinates and the cache coordinates, only updating the cache of the invalid area, wherein the cache is directly multiplexed by the non-invalid area; And S5, when the element moves, the attribute modifies, scrolls, scales or the resolution changes, performing differential invalidation marking on the corresponding local cache region, and realizing cache reconstruction through combination of redrawing and cache scaling. Furthermore, the automatic identification of the change element and the associated elements thereof specifically further comprises the steps of traversing all elements in the view, obtaining the display range of the current element and other elements, and