CN113096045A - Bitmap stretching method, bitmap stretching device and electronic equipment - Google Patents

Bitmap stretching method, bitmap stretching device and electronic equipment Download PDF

Info

Publication number
CN113096045A
CN113096045A CN202110401000.2A CN202110401000A CN113096045A CN 113096045 A CN113096045 A CN 113096045A CN 202110401000 A CN202110401000 A CN 202110401000A CN 113096045 A CN113096045 A CN 113096045A
Authority
CN
China
Prior art keywords
matrix
bitmap
longitudinal
displayed
size
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110401000.2A
Other languages
Chinese (zh)
Other versions
CN113096045B (en
Inventor
刘均
李河金
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Launch Technology Co Ltd
Original Assignee
Shenzhen Launch Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Launch Technology Co Ltd filed Critical Shenzhen Launch Technology Co Ltd
Priority to CN202110401000.2A priority Critical patent/CN113096045B/en
Publication of CN113096045A publication Critical patent/CN113096045A/en
Application granted granted Critical
Publication of CN113096045B publication Critical patent/CN113096045B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/73Deblurring; Sharpening
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The application discloses a bitmap stretching method and device, electronic equipment and a computer readable storage medium. Wherein, the method comprises the following steps: acquiring layout information of a bitmap to be displayed, wherein the layout information comprises pixel point information and size information; generating a matrix of the bitmap to be displayed based on the layout information, wherein the size of the matrix is determined according to the size information, and the value of each element in the matrix is determined according to the pixel point information; calculating the transverse stretching multiple and the longitudinal stretching multiple of the bitmap to be displayed according to the size information and the target size information; according to the transverse stretching multiple and the longitudinal stretching multiple, expanding the elements of the matrix to adjust the size of the matrix; and generating a stretched bitmap to be displayed based on the adjusted matrix. The method and the device can enable the stretched bitmap to still keep a good display effect, and reduce the phenomenon of display blurring or errors.

Description

Bitmap stretching method, bitmap stretching device and electronic equipment
Technical Field
The present application belongs to the field of bitmap processing technologies, and in particular, to a bitmap stretching method, a bitmap stretching device, an electronic device, and a computer-readable storage medium.
Background
In software development, bitmaps are often used to decorate software to form a unique style of the software. In this process, the bitmap may need to be stretched to fit the display interface. However, due to the inherent properties of bitmaps, the stretched bitmaps are distorted, resulting in an unaesthetic appearance of the displayed bitmaps, such as blurring or misalignment.
Disclosure of Invention
The application provides a bitmap stretching method, a bitmap stretching device, electronic equipment and a computer readable storage medium, which can enable stretched bitmaps to still keep good display effects and reduce display blurring or error phenomena.
In a first aspect, the present application provides a bitmap stretching method, including:
obtaining layout information of a bitmap to be displayed, wherein the layout information comprises pixel point information and size information;
generating a matrix of the bitmap to be displayed based on the layout information, wherein the size of the matrix is determined according to the size information, and the value of each element in the matrix is determined according to the pixel point information;
calculating the transverse stretching multiple and the longitudinal stretching multiple of the bitmap to be displayed according to the dimension information and the target dimension information;
according to the transverse stretching multiple and the longitudinal stretching multiple, matrix expansion operation is realized through copying elements of the matrix so as to adjust the size of the matrix;
and generating the stretched bitmap to be displayed based on the adjusted matrix.
Optionally, the generating a matrix of the bitmap to be displayed based on the layout information includes:
and creating a matrix with the same size as the bitmap to be displayed according to the layout information, wherein each element in the matrix corresponds to each pixel point in the bitmap to be displayed one by one, and the pixel points and the elements which correspond to each other have the same position information.
Optionally, the size information includes an original height and an original width, the target size information includes a target width and a target height, and the calculating the transverse stretching multiple and the longitudinal stretching multiple of the bitmap to be displayed according to the size information and the target size information includes:
calculating the width ratio of the target width to the original width as the transverse stretching multiple;
the height ratio of the target height to the original height is calculated as the longitudinal stretch factor.
Optionally, the performing a matrix expansion operation by copying elements of the matrix according to the transverse stretching factor and the longitudinal stretching factor to adjust the size of the matrix includes:
selecting an element to be copied in the matrix according to the transverse stretching multiple and the longitudinal stretching multiple;
and realizing matrix expansion operation by copying the element to be copied so as to adjust the size of the matrix.
Optionally, the to-be-copied element includes a transverse to-be-copied element and a longitudinal to-be-copied element, and selecting the to-be-copied element in the matrix according to the transverse stretching multiple and the longitudinal stretching multiple includes:
determining transverse elements to be copied in the matrix according to the transverse stretching multiple;
determining longitudinal elements to be copied in the matrix according to the longitudinal stretching multiple;
accordingly, the implementing a matrix expansion operation by copying the element to be copied to adjust the size of the matrix includes:
for each element to be copied, copying the element to be copied at a specified transverse orientation of the element to be copied at a specified transverse magnification to adjust the width of the matrix, wherein the specified transverse magnification is determined according to the transverse stretching magnification;
for each longitudinal element to be copied, copying the longitudinal element to be copied at a specified longitudinal multiple in a specified longitudinal orientation of the longitudinal element to be copied so as to adjust the height of the matrix, wherein the specified longitudinal multiple is determined according to the longitudinal stretching multiple.
Optionally, the generating the stretched bitmap to be displayed based on the adjusted matrix includes:
creating a null map having the same size as the adjusted matrix;
traversing each element of the adjusted matrix, and respectively restoring the value of each element into a corresponding pixel value;
and filling the empty bitmap based on the position of each element in the matrix and the pixel value corresponding to each element to obtain the stretched bitmap to be displayed.
Optionally, before the calculating the transverse stretching multiple and the longitudinal stretching multiple of the bitmap to be displayed according to the size information and the target size information, the method further includes:
determining a display mode of a target interface, wherein the target interface is an interface for preparing to display the bitmap to be displayed;
if the target interface is in a window mode, determining the target size information based on the size of the target interface;
and if the target interface is in a full screen mode, determining the target size information based on a preset default size.
In a second aspect, the present application provides a bitmap stretching apparatus, comprising:
the device comprises an acquisition unit, a display unit and a display unit, wherein the acquisition unit is used for acquiring layout information of a bitmap to be displayed, and the layout information comprises pixel point information and size information;
a first generating unit configured to generate a matrix of the bitmap to be displayed based on the layout information, wherein a size of the matrix is determined based on the size information, and a value of each element in the matrix is determined based on the pixel point information;
a calculating unit, configured to calculate a horizontal stretch ratio and a vertical stretch ratio of the bitmap to be displayed according to the size information and the target size information;
an adjusting unit, configured to implement a matrix expansion operation by copying elements of the matrix according to the transverse stretching factor and the longitudinal stretching factor, so as to adjust a size of the matrix;
and the second generating unit is used for generating the stretched bitmap to be displayed based on the adjusted matrix.
Optionally, the first generating unit is specifically configured to create, according to the layout information, a matrix having the same size as the bitmap to be displayed, where each element in the matrix corresponds to each pixel in the bitmap to be displayed one-to-one, and the pixels and the elements that correspond to each other have the same position information.
Optionally, the size information includes an original height and an original width, the target size information includes a target width and a target height, and the calculating unit includes:
the first calculating subunit is used for calculating the width ratio of the target width to the original width as the transverse stretching multiple;
and the second calculating subunit is used for calculating the height ratio of the target height to the original height as the longitudinal stretching multiple.
Optionally, the adjusting unit includes:
an element selection subunit, configured to select an element to be copied from the matrix according to the transverse stretching factor and the longitudinal stretching factor;
and the element replication sub-unit is used for realizing matrix expansion operation by replicating the element to be replicated so as to adjust the size of the matrix.
Optionally, the elements to be copied include a horizontal element to be copied and a vertical element to be copied; the element selection subunit includes:
a transverse element to be copied determining subunit, configured to determine a transverse element to be copied in the matrix according to the transverse stretching multiple;
a longitudinal element to be copied determining subunit, configured to determine a longitudinal element to be copied in the matrix according to the longitudinal stretching multiple;
accordingly, the above element replication subunit comprises:
an element transverse replication unit configured to replicate, for each element to be replicated in a specified transverse orientation of the element to be replicated in a specified transverse direction, the element to be replicated in the specified transverse direction by a specified transverse magnification determined according to the transverse stretching magnification, so as to adjust the width of the matrix;
and the element longitudinal replication unit is used for replicating the longitudinal element to be replicated in a specified longitudinal direction of the longitudinal element to be replicated according to a specified longitudinal multiple so as to adjust the height of the matrix, wherein the specified longitudinal multiple is determined according to the longitudinal stretching multiple.
Optionally, the second generating unit includes:
a bitmap creation subunit for creating a null bitmap having the same size as the adjusted matrix;
a pixel value reduction subunit, configured to traverse each element of the adjusted matrix, and reduce the value of each element to a corresponding pixel value;
and the bitmap filling subunit is used for filling the empty bitmap based on the positions of the elements in the matrix and the pixel values corresponding to the elements to obtain the stretched bitmap to be displayed.
Optionally, the bitmap stretching apparatus further includes:
a display mode determining unit, configured to determine a display mode of a target interface, where the target interface is an interface for preparing to display the bitmap to be displayed;
and a target size information determining unit, configured to determine the target size information based on a size of the target interface if the target interface is in a window mode, and determine the target size information based on a preset default size if the target interface is in a full-screen mode.
In a third aspect, the present application provides an electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to the first aspect when executing the computer program.
In a fourth aspect, the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of the first aspect.
In a fifth aspect, the present application provides a computer program product comprising a computer program which, when executed by one or more processors, performs the steps of the method of the first aspect as described above.
Compared with the prior art, the application has the beneficial effects that: firstly, obtaining layout information of a bitmap to be displayed, wherein the layout information comprises pixel point information and size information, then generating a matrix of the bitmap to be displayed based on the layout information, the size of the matrix is determined according to the size information, the value of each element in the matrix is determined according to the pixel point information, then according to the size information and target size information, calculating the transverse stretching multiple and longitudinal stretching multiple of the bitmap to be displayed, according to the transverse stretching multiple and the longitudinal stretching multiple, realizing matrix expansion operation through copying the elements of the matrix to adjust the size of the matrix, and finally generating the stretched bitmap to be displayed based on the adjusted matrix. In the process, the elements in the matrix corresponding to the bitmap to be displayed are copied to enable the matrix to be matched with the target size information, and then a new bitmap is restored based on the expanded matrix, so that the copying of the pixel points in the bitmap to be displayed is realized substantially, the newly generated bitmap can be matched with the target size information, and the phenomenon of poor beauty such as blurring or dislocation can be avoided. It is understood that the beneficial effects of the second aspect to the fifth aspect can be referred to the related description of the first aspect, and are not described herein again.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic flow chart of an implementation of a bitmap stretching method provided in an embodiment of the present application;
FIG. 2 is a schematic diagram of a bitmap to be displayed and a matrix thereof according to an embodiment of the present application;
FIG. 3 is a diagram illustrating an example of a matrix stretching in the transverse direction provided by an embodiment of the present application;
FIG. 4 is another exemplary illustration of the matrix stretching in the transverse direction provided by the embodiments of the present application;
FIG. 5 is a diagram of another example of a matrix cross-directional stretch provided by an embodiment of the present application;
FIG. 6 is an exemplary illustration of a longitudinal stretching of a matrix provided by an embodiment of the present application;
FIG. 7 is another exemplary illustration of the longitudinal stretching of the matrix provided by an embodiment of the present application;
FIG. 8 is a diagram of yet another example of a longitudinal stretching of a matrix provided by an embodiment of the present application;
FIG. 9 is a diagram illustrating an example matrix expansion operation provided by an embodiment of the present application;
FIG. 10 is a diagram of another example of matrix expansion operations provided by embodiments of the present application;
fig. 11 is a block diagram of a bitmap stretching apparatus provided in an embodiment of the present application;
fig. 12 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
In software development, it is often necessary to decorate software with bitmaps to form a unique style of the software itself, for example, the bitmaps are used as a background map of the software, the bitmaps are used as a start-up screen of the software, or the bitmaps are used to draw virtual buttons. When a bitmap is used as a background image of software, the size of a display interface of the software often exceeds the resolution of the bitmap, and the bitmap needs to be stretched to adapt to the display interface. However, due to the inherent properties of bitmaps, the stretched bitmaps are distorted, resulting in an unaesthetic appearance of displayed bitmaps, such as distortion or misalignment. Based on this, the embodiments of the present application provide a bitmap stretching method, a bitmap stretching apparatus, an electronic device, and a computer-readable storage medium, which can enable a stretched bitmap to still maintain a good display effect, and reduce display distortion or errors. In order to explain the technical solutions proposed in the embodiments of the present application, the following description will be given by way of specific examples.
The bitmap stretching method proposed in the embodiments of the present application is explained below. Referring to fig. 1, the bitmap stretching method includes:
step 101, obtaining layout information of a bitmap to be displayed.
In the embodiment of the application, each display interface of the software is pre-assigned with a corresponding bitmap. When a certain display interface receives a display instruction, the display interface can be determined as a target interface, and the bitmap corresponding to the display interface is the bitmap to be displayed. Generally, the bitmap corresponding to each display interface is stored in a preset resource file. The electronic equipment can load the bitmap to be displayed from the resource file and acquire the layout information of the bitmap to be displayed. The layout information comprises pixel point information and size information, the pixel point information comprises pixel values of all pixel points in the bitmap to be displayed, the size information is used for indicating the size of the bitmap to be displayed, and the size takes pixels as units.
In some embodiments, the electronic device may first obtain the width and height of the bitmap to be displayed, for example, the width is 295 pixels, and the height is 425 pixels, so as to obtain the size information of the bitmap to be displayed; and traversing each pixel in the bitmap to be displayed according to a specified sequence based on the width and the height of the bitmap to be displayed, for example, traversing the pixels in the bitmap to be displayed in a sequence from left to right and from top to bottom, and reading the pixel value of each pixel point to obtain the pixel point information of the bitmap to be displayed. It should be noted that the above-mentioned designated sequence may be set by the user, and is not limited herein. Specifically, considering that the color coding adopted by the bitmap for screen display is usually in RGB mode, the above operation of reading the pixel values of each pixel point is actually: and reading the pixel value of each pixel point in the R channel, the pixel value in the G channel and the pixel value in the B channel.
And 102, generating a matrix of the bitmap to be displayed based on the layout information.
In the embodiment of the present application, the electronic device may generate a matrix based on the layout information of the bitmap to be displayed, where the size of the matrix may be determined according to the size information of the bitmap to be displayed, and the value of each element in the matrix may be determined according to the pixel point information of the bitmap to be displayed. Specifically, the size of the matrix is the same as the size of the bitmap to be displayed, that is, the width of the matrix (the number of elements in each row in the matrix) is equal to the width of the bitmap to be displayed (the number of pixels in each row in the bitmap to be displayed), and the height of the matrix (the number of elements in each column in the matrix) is equal to the height of the bitmap to be displayed (the number of pixels in each column in the bitmap to be displayed). And each element in the matrix corresponds to each pixel point in the bitmap to be displayed one by one, and the pixel points and the elements which correspond to each other have the same position information.
In some embodiments, the value of each element may be 32 bits, represented by 16-ary. For example only, bits 0 to 7 may store pixel values of corresponding pixels in the R channel (referred to as a first byte), bits 8 to 15 may store pixel values of corresponding pixels in the G channel (referred to as a second byte), bits 16 to 23 may store pixel values of corresponding pixels in the B channel (referred to as a third byte), and bits 24 to 31 may store blank data (referred to as a blank byte). That is, the value of each element can be represented by a 16-ary numerical value of 4 bytes.
For example, referring to FIG. 2, a bitmap I to be displayed with a width of 8 pixels and a height of 10 pixels corresponds to 10 × 8(10 rows 8)Columns) of the matrix K. A pixel point in the jth row and ith column of the bitmap I to be displayed (i.e. a pixel point with coordinates (I, j) in the bitmap I to be displayed) and an element in the jth row and ith column of the matrix K (i.e. K)ji) Are corresponding to each other. Assuming that the pixel value of the pixel point with the coordinate (I, j) in the bitmap I to be displayed is RGB (255, 250, 251), the element K in the matrix K is correspondingly obtainedjiIs 0 xffffafb 00.
And 103, calculating the transverse stretching multiple and the longitudinal stretching multiple of the bitmap to be displayed according to the dimension information and the target dimension information.
In the embodiment of the present application, the target size information is used to indicate the size of the target interface (i.e. the display interface ready to display the bitmap to be displayed), and the size may also be in units of pixels. Generally, the target size information needs to be determined according to the display mode of the target interface: if the target interface is in the window mode, the target interface in the window mode can be freely controlled and stretched by a user, so that the target size information needs to be determined based on the real-time size of the target interface; on the contrary, if the target interface is in full screen mode, the target size information can be directly determined based on the preset default size because the screen size is fixed.
In some embodiments, the size information of the bitmap to be displayed obtained by the electronic device includes an original height (denoted as height) and an original width (denoted as width), and the obtained target size information includes a target width (denoted as new _ width) and a target height (denoted as new _ height), so that a width ratio of the target width to the original width (i.e., new _ width/width) can be calculated as the lateral stretching multiple and a height ratio of the target height to the original height (i.e., new _ height/height) can be calculated as the longitudinal stretching multiple.
And 104, according to the transverse stretching multiple and the longitudinal stretching multiple, realizing matrix expansion operation by copying elements of the matrix so as to adjust the size of the matrix.
In the present embodiment, the calculated stretch ratio (including the transverse stretch ratio and the longitudinal stretch ratio) is likely to be fractional, and in this case, a local element replication operation is required. Therefore, the electronic device can select the elements to be copied in the matrix according to the transverse stretching ratio and the longitudinal stretching ratio, and then realize the matrix expansion operation by copying the elements to be copied so as to adjust the size of the matrix. The following description is made for the transverse stretching and the longitudinal stretching, respectively:
for the transverse stretching, the electronic device determines transverse elements to be copied in the matrix according to the transverse stretching multiple, and then copies the transverse elements to be copied in the specified transverse orientation of the transverse elements to be copied by the specified transverse multiple according to the transverse stretching multiple to adjust the width of the matrix for each transverse element to be copied. For example only, the specified lateral orientation may be to the left.
In some embodiments, the transverse stretch factor (new _ width/width) can be divided into three types, which are integers greater than 1, fractions greater than 1 and less than 2, and fractions greater than 2.
Wherein if the transverse stretching multiple is an integer greater than 1, all elements in the matrix can be determined as transverse to-be-copied elements. To the left of each element to be copied, the element to be copied is copied with a specified transverse multiple, which is (new _ width/width) -1. That is, to the left of each element to be copied in the horizontal direction, add (new _ width/width) -1 corresponding element to be copied in the horizontal direction. Referring to fig. 3, an example of the transverse stretching is given in fig. 3, assuming a transverse stretching multiple of 3, based on a 2 × 2 matrix. In which the tilted bold letters represent copied elements (i.e., newly added elements).
Wherein, if the transverse stretching multiple is a decimal number larger than 1 and smaller than 2, determining the element with the specified proportion in each row of the matrix as the transverse copying element, wherein the specified proportion is the decimal part of the transverse stretching multiple, namely the specified proportion
Figure BDA0003020360290000101
For example, assuming that new _ width/width is 1.5, a small ratio of 1.5 is specifiedFraction 0.5, i.e. 50%; to the left of each element to be replicated, the element to be replicated is replicated with a specified lateral multiple of 1. That is, to the left of each element to be copied, 1 corresponding element to be copied is added. Referring to fig. 4, another example of the transverse stretching is given in fig. 4, assuming a transverse stretching multiple of 1.5 based on a 2 × 2 matrix. In which the tilted bold letters represent copied elements (i.e., newly added elements).
Wherein, if the transverse stretching multiple is a decimal larger than 2, the transverse stretching operation involves two times of copying: the first copying is to determine all elements in the matrix as elements to be copied transversely; on the left side of each element to be copied, copying the element to be copied by using the appointed transverse multiple, wherein the appointed transverse multiple is
Figure BDA0003020360290000111
That is, the first copying is to add a new copy to the left of each element to be copied determined this time
Figure BDA0003020360290000112
A corresponding element to be copied horizontally. The second copying is to determine the elements to be copied in the transverse direction in the specified proportion of each row of the matrix, wherein the specified proportion is the fractional part of the transverse stretching multiple, namely the specified proportion
Figure BDA0003020360290000113
For example, assuming that new _ width/width is 2.5, the fractional part of the specified ratio is 0.5, i.e., 50%, of 2.5; and on the left side of each element to be copied determined at this time, copying the element to be copied at the appointed horizontal multiple at this time, wherein the appointed horizontal multiple at this time is 1. That is, the second copying is to add 1 corresponding horizontal element to be copied to the left of each horizontal element to be copied determined this time. Referring to FIG. 5, based on a 2X 2 matrix, assuming a transverse stretch ratio of 2.5, FIG. 5 shows yet another transverse stretchExamples are given. In which the tilted bold letters represent copied elements (i.e., newly added elements).
For longitudinal stretching, the electronic device determines longitudinal elements to be copied in the matrix according to a longitudinal stretching multiple, and then copies the longitudinal elements to be copied in a specified longitudinal direction of the longitudinal elements to be copied by a specified longitudinal multiple according to the longitudinal stretching multiple for each longitudinal element to be copied so as to adjust the height of the matrix. For example only, the specified longitudinal orientation may be below.
In some embodiments, the longitudinal stretch factor (new _ height/height) may be divided into three types, which are integers greater than 1, fractions greater than 1 and less than 2, and fractions greater than 2.
Wherein if the longitudinal stretching multiple is an integer greater than 1, all elements in the matrix can be determined as the longitudinal element to be copied. Under each element to be copied, copying the element to be copied in the vertical direction by a specified vertical multiple, wherein the specified vertical multiple is (new _ height/height) -1. That is, (new _ height/height) -1 corresponding element to be copied in the vertical direction is newly added below each element to be copied in the vertical direction. Referring to fig. 6, an example of longitudinal stretching is given in fig. 6, assuming a longitudinal stretching multiple of 3, based on a 2 × 2 matrix. In which the tilted bold letters represent copied elements (i.e., newly added elements).
Wherein, if the longitudinal stretching multiple is a decimal number larger than 1 and smaller than 2, determining the element with the specified proportion in each row of the matrix as the element to be longitudinally copied, wherein the specified proportion is the decimal part of the longitudinal stretching multiple, namely the specified proportion
Figure BDA0003020360290000121
For example, assuming that new _ height/height is 1.5, a fractional portion of 0.5, i.e., 50%, is specified for a ratio of 1.5; and copying the elements to be copied in the vertical direction under each element to be copied in the vertical direction determined at this time by using a specified vertical multiple, wherein the specified vertical multiple is 1. I.e. under each longitudinal element to be copiedAnd 1 corresponding longitudinal element to be copied is added. Referring to fig. 7, another example of longitudinal stretching is given in fig. 7, based on a 2 × 2 matrix, assuming a longitudinal stretch factor of 1.5. In which the tilted bold letters represent copied elements (i.e., newly added elements).
Wherein, if the longitudinal stretching multiple is a decimal larger than 2, the longitudinal stretching operation involves two times of copying: the first copying is to determine all elements in the matrix as longitudinal elements to be copied; under each longitudinal element to be copied determined at this time, copying the longitudinal element to be copied by the appointed longitudinal multiple at this time, wherein the appointed longitudinal multiple at this time is
Figure BDA0003020360290000122
That is, the first copying is to add new copy under each determined longitudinal copy-waiting element
Figure BDA0003020360290000123
A corresponding longitudinal element to be copied. The second copying is to determine the elements in each row of the matrix with the specified proportion as the elements to be copied, wherein the specified proportion is the fractional part of the longitudinal stretching multiple, namely the specified proportion
Figure BDA0003020360290000124
For example, assuming new _ height/height is 2.5, a fractional portion of 0.5, i.e., 25%, is specified for a ratio of 2.5; and under each longitudinal element to be copied determined at this time, copying the longitudinal element to be copied by the appointed longitudinal multiple at this time, wherein the appointed longitudinal multiple at this time is 1. That is, the second time of copying is to add 1 corresponding longitudinal element to be copied below each longitudinal element to be copied determined this time. Referring to fig. 8, a further example of longitudinal stretching is given in fig. 8, based on a 2 x 2 matrix, assuming a longitudinal stretch factor of 2.5. In which the tilted bold letters represent copied elements (i.e., newly added elements).
In some embodiments, the electronic device may choose to stretch the matrix in the lateral and longitudinal directions in sequence; namely, transverse stretching of the matrix is completed firstly, and then longitudinal stretching is performed on the basis of the matrix after transverse stretching is completed; or the longitudinal stretching of the matrix is firstly completed, and then the transverse stretching is carried out on the basis of the matrix with the longitudinal stretching. Referring to fig. 9, an example of the matrix expansion process is shown in fig. 9, based on a 2 × 2 matrix, assuming a 3 lateral stretch and a 2.5 longitudinal stretch. Or, the electronic device may also choose to stretch the matrix in the horizontal and vertical directions at the same time, in this case, there may be blank positions (that is, blank elements) in the diagonal direction (lower left) of the element to be copied, and at this time, it is only necessary to copy the element to be copied to the corresponding blank positions again. Referring to fig. 10, another example of the matrix expansion process is shown in fig. 10, based on a 2 × 2 matrix, assuming a 3 lateral stretch and a 2.5 longitudinal stretch. In fig. 9 and 10, the bold oblique letters indicate copied elements (i.e., newly added elements). The rectangular box in fig. 10 represents a blank element.
It should be noted that, because the bitmap to be displayed is pre-stored in the designated resource, that is, the bitmap to be displayed is known to the electronic device, the electronic device may analyze the bitmap to be displayed in advance to determine which pixels in the bitmap to be displayed are more suitable for copying. It is generally believed that pixels in the regions of the bitmap that tend to be solid are more suitable for replication. After the analysis, a copy weight may be assigned to each pixel point of the bitmap to be displayed. The larger the copy weight is, the more suitable the pixel point is for copying; the smaller the copy weight is, the less suitable the pixel point is for copying. Therefore, when the elements to be copied are required to be selected in each row/each column of the matrix according to the specified proportion, the elements to be copied can be selected according to the copying weight of each pixel point on each row/each column, so that the pixel points with large copying weight can be preferentially selected as the elements to be copied, and the phenomenon of blurring or dislocation of the stretched bitmap to be displayed is further ensured not to occur.
And 105, generating the stretched bitmap to be displayed based on the adjusted matrix.
In the present embodiment, step 105 can be seen as actuallyThe reverse operation of step 102 is performed: step 102, generating a matrix according to a bitmap; step 105 is to obtain a bitmap according to matrix restoration. It is noted, however, that the matrix in step 105 has been adjusted and its size has changed. The electronic device will first create a null map (i.e., having a width new width and a height new height) having the same size as the adjusted matrix. Then, traversing each element of the adjusted matrix, and respectively restoring the value of each element to a corresponding pixel value, wherein the restoration formula is as follows: for the element K in the adjusted matrix KmnIn other words, R ═ (k)mn>>24)&0xFF,G=(kmn>>16)&0xFF,B=(kmn>>8)&0xFF, wherein R is the pixel value of the R channel, G is the pixel value of the G channel, and B is the pixel value of the B channel. And finally, filling the empty bitmap based on the position of each element in the adjusted matrix and the pixel value corresponding to each element, and obtaining the stretched bitmap to be displayed. For example, the element kmnIn matrix K', the element in the mth row and nth column, the pixel value of the pixel point in the mth row and nth column in the null bitmap (i.e. the pixel point with the coordinate of (n, m)) can be set based on the element KmnThe resulting pixel values are restored.
As can be seen from the above, according to the embodiment of the present application, first, layout information of a bitmap to be displayed is obtained, where the layout information includes pixel point information and size information, and then, based on the layout information, a matrix of the bitmap to be displayed is generated, where a size of the matrix is determined according to the size information, and values of elements in the matrix are determined according to the pixel point information, then, according to the size information and target size information, a transverse stretching multiple and a longitudinal stretching multiple of the bitmap to be displayed are calculated, and according to the transverse stretching multiple and the longitudinal stretching multiple, a matrix expansion operation is implemented by copying the elements of the matrix to adjust the size of the matrix, and finally, based on the adjusted matrix, the bitmap to be displayed is generated after stretching. In the process, the elements in the matrix corresponding to the bitmap to be displayed are copied to enable the matrix to be matched with the target size information, and then a new bitmap is restored based on the expanded matrix, so that the copying of the pixel points in the bitmap to be displayed is realized substantially, the newly generated bitmap can be matched with the target size information, and the phenomenon of poor beauty such as blurring or dislocation can be avoided.
Corresponding to the bitmap stretching method provided above, the embodiment of the present application further provides a bitmap stretching device. As shown in fig. 11, the bitmap stretching apparatus 1100 includes:
an obtaining unit 1101, configured to obtain layout information of a bitmap to be displayed, where the layout information includes pixel point information and size information;
a first generating unit 1102 configured to generate a matrix of the bitmap to be displayed, based on the layout information, where a size of the matrix is determined according to the size information, and values of respective elements in the matrix are determined according to the pixel point information;
a calculating unit 1103, configured to calculate a horizontal stretch ratio and a vertical stretch ratio of the bitmap to be displayed according to the size information and the target size information;
an adjusting unit 1104, configured to adjust a size of the matrix by performing a matrix expansion operation by copying elements of the matrix according to the transverse stretching factor and the longitudinal stretching factor;
a second generating unit 1105, configured to generate the stretched bitmap to be displayed based on the adjusted matrix.
Optionally, the first generating unit 1102 is specifically configured to create, according to the layout information, a matrix having the same size as the bitmap to be displayed, where each element in the matrix corresponds to each pixel in the bitmap to be displayed one to one, and the pixels and the elements that correspond to each other have the same position information.
Optionally, the size information includes an original height and an original width, the target size information includes a target width and a target height, and the calculating unit 1103 includes:
the first calculating subunit is used for calculating the width ratio of the target width to the original width as the transverse stretching multiple;
and the second calculating subunit is used for calculating the height ratio of the target height to the original height as the longitudinal stretching multiple.
Optionally, the adjusting unit 1104 includes:
an element selection subunit, configured to select an element to be copied from the matrix according to the transverse stretching factor and the longitudinal stretching factor;
and the element replication sub-unit is used for realizing matrix expansion operation by replicating the element to be replicated so as to adjust the size of the matrix.
Optionally, the elements to be copied include a horizontal element to be copied and a vertical element to be copied; the element selection subunit includes:
a transverse element to be copied determining subunit, configured to determine a transverse element to be copied in the matrix according to the transverse stretching multiple;
a longitudinal element to be copied determining subunit, configured to determine a longitudinal element to be copied in the matrix according to the longitudinal stretching multiple;
accordingly, the above element replication subunit comprises:
an element transverse replication unit configured to replicate, for each element to be replicated in a specified transverse orientation of the element to be replicated in a specified transverse direction, the element to be replicated in the specified transverse direction by a specified transverse magnification determined according to the transverse stretching magnification, so as to adjust the width of the matrix;
and the element longitudinal replication unit is used for replicating the longitudinal element to be replicated in a specified longitudinal direction of the longitudinal element to be replicated according to a specified longitudinal multiple so as to adjust the height of the matrix, wherein the specified longitudinal multiple is determined according to the longitudinal stretching multiple.
Optionally, the second generating unit 1105 includes:
a bitmap creation subunit for creating a null bitmap having the same size as the adjusted matrix;
a pixel value reduction subunit, configured to traverse each element of the adjusted matrix, and reduce the value of each element to a corresponding pixel value;
and the bitmap filling subunit is used for filling the empty bitmap based on the positions of the elements in the matrix and the pixel values corresponding to the elements to obtain the stretched bitmap to be displayed.
Optionally, the bitmap stretching apparatus 1100 further includes:
a display mode determining unit, configured to determine a display mode of a target interface, where the target interface is an interface for preparing to display the bitmap to be displayed;
and a target size information determining unit, configured to determine the target size information based on a size of the target interface if the target interface is in a window mode, and determine the target size information based on a preset default size if the target interface is in a full-screen mode.
As can be seen from the above, according to the embodiment of the present application, first, layout information of a bitmap to be displayed is obtained, where the layout information includes pixel point information and size information, and then, based on the layout information, a matrix of the bitmap to be displayed is generated, where a size of the matrix is determined according to the size information, and values of elements in the matrix are determined according to the pixel point information, then, according to the size information and target size information, a transverse stretching multiple and a longitudinal stretching multiple of the bitmap to be displayed are calculated, and according to the transverse stretching multiple and the longitudinal stretching multiple, a matrix expansion operation is implemented by copying the elements of the matrix to adjust the size of the matrix, and finally, based on the adjusted matrix, the bitmap to be displayed is generated after stretching. In the process, the elements in the matrix corresponding to the bitmap to be displayed are copied to enable the matrix to be matched with the target size information, and then a new bitmap is restored based on the expanded matrix, so that the copying of the pixel points in the bitmap to be displayed is realized substantially, the newly generated bitmap can be matched with the target size information, and the phenomenon of poor beauty such as blurring or dislocation can be avoided.
Corresponding to the bitmap stretching method provided above, an embodiment of the present application further provides an electronic device. Referring to fig. 12, an electronic device 12 in the embodiment of the present application includes: a memory 1201, one or more processors 1202 (only one shown in fig. 12), and a computer program stored on the memory 1201 and executable on the processors. Wherein: the memory 1201 is used for storing software programs and units, and the processor 1202 executes various functional applications and diagnoses by operating the software programs and units stored in the memory 1201, so as to acquire resources corresponding to the preset events. Specifically, the processor 1202 implements the following steps by running the above-mentioned computer program stored in the memory 1201:
obtaining layout information of a bitmap to be displayed, wherein the layout information comprises pixel point information and size information;
generating a matrix of the bitmap to be displayed based on the layout information, wherein the size of the matrix is determined according to the size information, and the value of each element in the matrix is determined according to the pixel point information;
calculating the transverse stretching multiple and the longitudinal stretching multiple of the bitmap to be displayed according to the dimension information and the target dimension information;
according to the transverse stretching multiple and the longitudinal stretching multiple, matrix expansion operation is realized through copying elements of the matrix so as to adjust the size of the matrix;
and generating the stretched bitmap to be displayed based on the adjusted matrix.
Assuming that the above is the first possible implementation manner, in a second possible implementation manner provided on the basis of the first possible implementation manner, the generating a matrix of the bitmap to be displayed based on the layout information includes:
and creating a matrix with the same size as the bitmap to be displayed according to the layout information, wherein each element in the matrix corresponds to each pixel point in the bitmap to be displayed one by one, and the pixel points and the elements which correspond to each other have the same position information.
In a third possible embodiment based on the first possible embodiment, the calculating the lateral stretching factor and the longitudinal stretching factor of the bitmap to be displayed according to the size information and the target size information includes:
calculating the width ratio of the target width to the original width as the transverse stretching multiple;
the height ratio of the target height to the original height is calculated as the longitudinal stretch factor.
In a fourth possible embodiment based on the first possible embodiment, the performing a matrix expansion operation by copying elements of the matrix according to the transverse stretching factor and the longitudinal stretching factor to adjust the size of the matrix includes:
selecting elements to be copied in the matrix according to the transverse stretching multiple and the longitudinal stretching multiple;
and realizing matrix expansion operation by copying the element to be copied so as to adjust the size of the matrix.
In a fifth possible implementation manner provided as the basis of the fourth possible implementation manner, the element to be copied includes an element to be copied in a transverse direction and an element to be copied in a longitudinal direction, and the selecting the element to be copied in the matrix according to the transverse stretching ratio and the longitudinal stretching ratio includes:
determining transverse elements to be copied in the matrix according to the transverse stretching multiple;
determining longitudinal elements to be copied in the matrix according to the longitudinal stretching multiple;
accordingly, the implementing a matrix expansion operation by copying the element to be copied to adjust the size of the matrix includes:
for each element to be copied, copying the element to be copied in a specified transverse orientation of the element to be copied in a specified transverse multiple to adjust the width of the matrix, wherein the specified transverse multiple is determined according to the transverse stretching multiple;
and for each longitudinal element to be copied, copying the longitudinal element to be copied in a specified longitudinal direction of the longitudinal element to be copied by a specified longitudinal multiple to adjust the height of the matrix, wherein the specified longitudinal multiple is determined according to the longitudinal stretching multiple.
In a sixth possible embodiment based on the first possible embodiment, the generating a stretched bitmap to be displayed based on the adjusted matrix includes:
creating a null map having the same size as the adjusted matrix;
traversing each element of the adjusted matrix, and respectively restoring the value of each element into a corresponding pixel value;
and filling the empty bitmap based on the position of each element in the matrix and the pixel value corresponding to each element to obtain the stretched bitmap to be displayed.
In a seventh possible implementation manner provided based on the first possible implementation manner, the second possible implementation manner, the three possible implementation manners, the fourth possible implementation manner, the fifth possible implementation manner, or the sixth possible implementation manner, before the calculation of the lateral stretching factor and the longitudinal stretching factor of the bitmap to be displayed according to the size information and the target size information, the processor 1202 further implements the following steps when running the computer program stored in the memory 1201:
determining a display mode of a target interface, wherein the target interface is an interface for preparing to display the bitmap to be displayed;
if the target interface is in a window mode, determining the target size information based on the size of the target interface;
and if the target interface is in a full-screen mode, determining the target size information based on a preset default size.
It should be understood that in the embodiments of the present Application, the Processor 1202 may be a Central Processing Unit (CPU), and the Processor may be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 1201 may include both read-only memory and random access memory and provides instructions and data to the processor 1202. Some or all of memory 1201 may also include non-volatile random access memory. For example, the memory 1201 may also store information of device classes.
As can be seen from the above, according to the embodiment of the present application, first, layout information of a bitmap to be displayed is obtained, where the layout information includes pixel point information and size information, and then, based on the layout information, a matrix of the bitmap to be displayed is generated, where a size of the matrix is determined according to the size information, and values of elements in the matrix are determined according to the pixel point information, then, according to the size information and target size information, a transverse stretching multiple and a longitudinal stretching multiple of the bitmap to be displayed are calculated, and according to the transverse stretching multiple and the longitudinal stretching multiple, a matrix expansion operation is implemented by copying the elements of the matrix to adjust the size of the matrix, and finally, based on the adjusted matrix, the bitmap to be displayed is generated after stretching. In the process, the elements in the matrix corresponding to the bitmap to be displayed are copied to enable the matrix to be matched with the target size information, and then a new bitmap is restored based on the expanded matrix, so that the copying of the pixel points in the bitmap to be displayed is realized substantially, the newly generated bitmap can be matched with the target size information, and the phenomenon of poor beauty such as blurring or dislocation can be avoided.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned functions may be distributed as different functional units and modules according to needs, that is, the internal structure of the apparatus may be divided into different functional units or modules to implement all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art would appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of external device software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described system embodiments are merely illustrative, and for example, the division of the above-described modules or units is only one logical functional division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The integrated unit may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, all or part of the flow in the method of the embodiments described above can be realized by a computer program, which can be stored in a computer-readable storage medium and can realize the steps of the embodiments of the methods described above when the computer program is executed by a processor. The computer program includes computer program code, and the computer program code may be in a source code form, an object code form, an executable file or some intermediate form. The computer-readable storage medium may include: any entity or device capable of carrying the above-described computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer readable Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signal, telecommunication signal, software distribution medium, etc. It should be noted that the computer readable storage medium may contain other contents which can be appropriately increased or decreased according to the requirements of the legislation and the patent practice in the jurisdiction, for example, in some jurisdictions, the computer readable storage medium does not include an electrical carrier signal and a telecommunication signal according to the legislation and the patent practice.
The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A method of bitmap stretching, comprising:
obtaining layout information of a bitmap to be displayed, wherein the layout information comprises pixel point information and size information;
generating a matrix of the bitmap to be displayed based on the layout information, wherein the size of the matrix is determined according to the size information, and the value of each element in the matrix is determined according to the pixel point information;
calculating the transverse stretching multiple and the longitudinal stretching multiple of the bitmap to be displayed according to the size information and the target size information;
according to the transverse stretching multiple and the longitudinal stretching multiple, matrix expansion operation is realized through copying elements of the matrix so as to adjust the size of the matrix;
and generating the stretched bitmap to be displayed based on the adjusted matrix.
2. The bitmap stretching method of claim 1, wherein the generating the matrix of the bitmap to be displayed based on the layout information comprises:
and creating a matrix with the same size as the bitmap to be displayed according to the layout information, wherein each element in the matrix corresponds to each pixel point in the bitmap to be displayed one by one, and the pixel points and the elements which correspond to each other have the same position information.
3. The bitmap stretching method according to claim 1, wherein the size information comprises an original height and an original width, the target size information comprises a target width and a target height, and the calculating the lateral stretching factor and the longitudinal stretching factor of the bitmap to be displayed according to the size information and the target size information comprises:
calculating the width ratio of the target width to the original width as the transverse stretching multiple;
the height ratio of the target height to the original height is calculated as the longitudinal stretch factor.
4. The bitmap stretching method of claim 1, wherein the performing a matrix expansion operation by copying elements of the matrix according to the transverse stretching factor and the longitudinal stretching factor to adjust the size of the matrix comprises:
selecting an element to be copied in the matrix according to the transverse stretching multiple and the longitudinal stretching multiple;
and realizing matrix expansion operation by copying the element to be copied so as to adjust the size of the matrix.
5. The bitmap stretching method of claim 4, wherein the elements to be replicated comprise elements to be replicated in a transverse direction and elements to be replicated in a longitudinal direction, and the selecting the elements to be replicated in the matrix according to the transverse stretching factor and the longitudinal stretching factor comprises:
determining transverse elements to be copied in the matrix according to the transverse stretching multiple;
determining longitudinal elements to be copied in the matrix according to the longitudinal stretching multiple;
accordingly, the implementing a matrix expansion operation by copying the element to be copied to adjust the size of the matrix includes:
for each element to be copied, copying the element to be copied at a specified transverse orientation of the element to be copied at a specified transverse magnification to adjust the width of the matrix, wherein the specified transverse magnification is determined according to the transverse stretching magnification;
for each longitudinal element to be copied, copying the longitudinal element to be copied at a specified longitudinal multiple in a specified longitudinal orientation of the longitudinal element to be copied so as to adjust the height of the matrix, wherein the specified longitudinal multiple is determined according to the longitudinal stretching multiple.
6. The bitmap stretching method according to claim 1, wherein the generating the stretched bitmap to be displayed based on the adjusted matrix comprises:
creating a null map having the same size as the adjusted matrix;
traversing each element of the adjusted matrix, and respectively restoring the value of each element into a corresponding pixel value;
and filling the empty bitmap based on the position of each element in the matrix and the pixel value corresponding to each element to obtain the stretched bitmap to be displayed.
7. The bitmap stretching method according to any one of claims 1 to 6, further comprising, before the calculating the lateral stretching factor and the longitudinal stretching factor of the bitmap to be displayed according to the size information and the target size information:
determining a display mode of a target interface, wherein the target interface is an interface for preparing to display the bitmap to be displayed;
if the target interface is in a window mode, determining the target size information based on the size of the target interface;
and if the target interface is in a full screen mode, determining the target size information based on a preset default size.
8. A bitmap stretching apparatus, comprising:
the device comprises an acquisition unit, a display unit and a display unit, wherein the acquisition unit is used for acquiring layout information of a bitmap to be displayed, and the layout information comprises pixel point information and size information;
a first generating unit, configured to generate a matrix of the bitmap to be displayed based on the layout information, where a size of the matrix is determined according to the size information, and a value of each element in the matrix is determined according to the pixel point information;
the calculation unit is used for calculating the transverse stretching multiple and the longitudinal stretching multiple of the bitmap to be displayed according to the size information and the target size information;
the adjusting unit is used for realizing matrix expansion operation through copying elements of the matrix according to the transverse stretching multiple and the longitudinal stretching multiple so as to adjust the size of the matrix;
and the second generating unit is used for generating the stretched bitmap to be displayed based on the adjusted matrix.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method of any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
CN202110401000.2A 2021-04-14 2021-04-14 Bitmap stretching method, bitmap stretching device and electronic equipment Active CN113096045B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110401000.2A CN113096045B (en) 2021-04-14 2021-04-14 Bitmap stretching method, bitmap stretching device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110401000.2A CN113096045B (en) 2021-04-14 2021-04-14 Bitmap stretching method, bitmap stretching device and electronic equipment

Publications (2)

Publication Number Publication Date
CN113096045A true CN113096045A (en) 2021-07-09
CN113096045B CN113096045B (en) 2024-09-10

Family

ID=76677399

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110401000.2A Active CN113096045B (en) 2021-04-14 2021-04-14 Bitmap stretching method, bitmap stretching device and electronic equipment

Country Status (1)

Country Link
CN (1) CN113096045B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113724138A (en) * 2021-09-09 2021-11-30 北京京隽科技有限公司 Image resolution expansion processing method and device and control terminal
CN114461112A (en) * 2022-01-28 2022-05-10 海宁奕斯伟集成电路设计有限公司 Image display method and device for screen menu type regulating mode

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07110859A (en) * 1993-10-14 1995-04-25 Matsushita Electric Ind Co Ltd Picture processing method and its device
JP2006262305A (en) * 2005-03-18 2006-09-28 Seiko Epson Corp Pixel interpolator and pixel interpolation program
JP2007183988A (en) * 1996-10-30 2007-07-19 Oki Data Corp Apparatus for enlarging image data
CN102253818A (en) * 2011-06-27 2011-11-23 深圳市茁壮网络股份有限公司 Background picture display method and device
CN108986033A (en) * 2018-07-26 2018-12-11 西安电子科技大学 Image-scaling method based on bilinear interpolation algorithm processing
CN109658332A (en) * 2017-10-10 2019-04-19 凌云光技术集团有限责任公司 A kind of image magnification method and terminal based on stream data processing
CN109934773A (en) * 2019-03-13 2019-06-25 北京旷视科技有限公司 A kind of image processing method, device, electronic equipment and computer-readable medium
CN111476718A (en) * 2020-04-15 2020-07-31 深圳市爱协生科技有限公司 Image amplification method and device, storage medium and terminal equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07110859A (en) * 1993-10-14 1995-04-25 Matsushita Electric Ind Co Ltd Picture processing method and its device
JP2007183988A (en) * 1996-10-30 2007-07-19 Oki Data Corp Apparatus for enlarging image data
JP2006262305A (en) * 2005-03-18 2006-09-28 Seiko Epson Corp Pixel interpolator and pixel interpolation program
CN102253818A (en) * 2011-06-27 2011-11-23 深圳市茁壮网络股份有限公司 Background picture display method and device
CN109658332A (en) * 2017-10-10 2019-04-19 凌云光技术集团有限责任公司 A kind of image magnification method and terminal based on stream data processing
CN108986033A (en) * 2018-07-26 2018-12-11 西安电子科技大学 Image-scaling method based on bilinear interpolation algorithm processing
CN109934773A (en) * 2019-03-13 2019-06-25 北京旷视科技有限公司 A kind of image processing method, device, electronic equipment and computer-readable medium
CN111476718A (en) * 2020-04-15 2020-07-31 深圳市爱协生科技有限公司 Image amplification method and device, storage medium and terminal equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113724138A (en) * 2021-09-09 2021-11-30 北京京隽科技有限公司 Image resolution expansion processing method and device and control terminal
CN114461112A (en) * 2022-01-28 2022-05-10 海宁奕斯伟集成电路设计有限公司 Image display method and device for screen menu type regulating mode

Also Published As

Publication number Publication date
CN113096045B (en) 2024-09-10

Similar Documents

Publication Publication Date Title
US8576242B2 (en) Image processing using meshes and gradient information
US20190339970A1 (en) Arithmetic processing device for deep learning and control method of the arithmetic processing device for deep learning
US5952994A (en) Method for scaling an image
US20160292838A1 (en) Image synthesis apparatus, image synthesis method, and recording medium
CN113096045A (en) Bitmap stretching method, bitmap stretching device and electronic equipment
US5161035A (en) Digital image processing device for enlarging original image with high fidelity
CN105930464B (en) Web rich media cross-screen adaptation method and device
CN111383232A (en) Matting method, matting device, terminal equipment and computer-readable storage medium
US20130335452A1 (en) System and method for scaling vector-based graphic designs
US5491769A (en) Method and apparatus for variable minification of an image
CN111476718A (en) Image amplification method and device, storage medium and terminal equipment
WO2022116936A1 (en) Interface layout method, electronic device, and computer-readable storage medium.
CN112380357A (en) Method for realizing interactive navigation of knowledge graph visualization
CN110363837A (en) The processing method and processing device of texture image, electronic equipment, storage medium in game
CN109062885A (en) Method, device and equipment for adjusting layout of text box
CN109598672B (en) Map road rendering method and device
CN106535002B (en) Desktop starter template layout updating method and device
CA1268870A (en) Circuit to effect raster operations
EP0574245A2 (en) Method and apparatus for variable expansion and variable shrinkage of an image
CN111435589A (en) Target display method and device and target display system
CN107977923B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
US5838297A (en) Method for color image scaling and other geometrical transformations
EP0538057A2 (en) Improvements in or relating to electronic graphic systems
JP2642374B2 (en) Figure clipping method
JP3517982B2 (en) Drawing device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant