CN109360253B - Drawing method of large-pixel BMP format image - Google Patents

Drawing method of large-pixel BMP format image Download PDF

Info

Publication number
CN109360253B
CN109360253B CN201811135174.3A CN201811135174A CN109360253B CN 109360253 B CN109360253 B CN 109360253B CN 201811135174 A CN201811135174 A CN 201811135174A CN 109360253 B CN109360253 B CN 109360253B
Authority
CN
China
Prior art keywords
canvas
image
drawn
coordinate point
partial
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.)
Active
Application number
CN201811135174.3A
Other languages
Chinese (zh)
Other versions
CN109360253A (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.)
Kocel Intelligent Machinery Ltd
Original Assignee
Kocel Intelligent Machinery 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 Kocel Intelligent Machinery Ltd filed Critical Kocel Intelligent Machinery Ltd
Priority to CN201811135174.3A priority Critical patent/CN109360253B/en
Publication of CN109360253A publication Critical patent/CN109360253A/en
Application granted granted Critical
Publication of CN109360253B publication Critical patent/CN109360253B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/40Filling a planar surface by adding surface attributes, e.g. colour or texture
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention provides a drawing method of a large-pixel BMP format image, which comprises the following steps: pre-dividing an image to be drawn into a first image and a second image; establishing a first canvas; establishing a second canvas, digging out the positions of partial canvases occupied by the second image on the first canvas, storing the positions on the second canvas, and recording the identification coordinate points of the positions of the partial canvases which are dubbed out on the first canvas; drawing a first image and a second image on a first canvas and a second canvas, respectively; filling a second canvas drawn with a second image into the first canvas to form a large image drawn on the same canvas; the invention adopts the method of drawing and supplementing on canvas with the same size to solve the problem that larger pixel pictures can not be drawn by adopting a common drawing method, and the method is simpler and more convenient in understanding and code realization and has a certain use value.

Description

Drawing method of large-pixel BMP format image
Technical Field
The invention relates to the technical field of software programming image processing, in particular to a drawing method of a large-pixel BMP format image.
Background
The processing method for the image in the program generally comprises the steps of converting pixel coordinates by collecting two-dimensional vector coordinates and then calling a drawing tool library such as: easyX, GDI, GUI, but EasyX, GDI, GUI, etc. have a certain limitation on the pixel size of the picture, when the pixel size of the picture exceeds the limit range, the program cannot create the canvas with the pixel size, or the canvas with the pixel size can be created successfully, but the picture can only be drawn locally and cannot be drawn into a complete picture, so that the picture with large pixel is drawn into a certain technical bottleneck.
For example, c++ provided drawing tools library draws 60253 x 17181 pixels of BMP format pictures only to draw partial pictures. Referring to the following drawings in detail, wherein fig. 1 is a target drawing picture, and fig. 8 is an actual drawing incomplete picture.
Disclosure of Invention
It is necessary to propose a method for rendering large-pixel BMP-format images.
A drawing method of a large-pixel BMP format image comprises the following steps:
pre-dividing an image to be drawn into a first image and a second image;
establishing a first canvas and a second canvas;
digging out the position of the partial image occupied by the second image on the first canvas, storing the position of the partial image occupied by the second image on the second canvas, and recording the identification coordinate point of the position of the partial image which is dug out on the first canvas;
drawing a first image and a second image on a first canvas and a second canvas, respectively;
filling a second canvas drawn with a second image into the first canvas, and keeping the initial coordinate point of the second canvas coincident with the identification coordinate point on the first canvas to form a large image drawn on the same canvas;
and storing the first canvas output in a final BMP file to finish the output of the matted filling large-pixel image.
Preferably, the maximum side length of the first image and the second image is not more than 60253/2.
Preferably, the coordinates of the identification coordinate points of the position of the partial image to be scratched on the first canvas are (Xa, ya, W, H), wherein Xa and Ya are the coordinates of the X axis and the coordinates of the Y axis of the canvas respectively, W is the length of the partial canvas to be scratched, and H is the height of the partial canvas to be scratched, so as to uniquely locate the position and the contour of the partial image to be scratched.
Preferably, the image to be drawn is pre-divided into a first image, a second image and a third image along the X-axis direction;
establishing a first canvas, establishing a second canvas and establishing a third canvas;
digging out the position of a second partial image occupied by the second image on the first canvas, storing the position of the second partial image on the second canvas, and recording a second identification coordinate point of the position of the second partial image which is dug out on the first canvas; digging out a third part of image position occupied by the third image on the first canvas, storing the third part of image position occupied by the third image on the third canvas, and recording a third identification coordinate point of the scratched third part of image position on the first canvas;
drawing a first image, a second image and a third image on a first canvas, a second canvas and a third canvas respectively;
filling a second canvas drawn with a second image into the first canvas, and keeping the initial coordinate point of the second canvas coincident with a second identification coordinate point on the first canvas; filling a third canvas drawn with a third image into the first canvas, and keeping the initial coordinate point of the third canvas coincident with a third identification coordinate point on the first canvas to form a large image drawn on the same canvas;
and storing the first canvas output in a final BMP file to finish the output of the matted filling large-pixel image.
Preferably, the image to be drawn is pre-divided into a first image, a second image and a third image along the X-axis and Y-axis directions;
establishing a first canvas, establishing a second canvas and establishing a third canvas;
digging out the position of a second partial image occupied by the second image on the first canvas, storing the position of the second partial image on the second canvas, and recording a second identification coordinate point of the position of the second partial image which is dug out on the first canvas; digging out a third part of image position occupied by the third image on the first canvas, storing the third part of image position occupied by the third image on the third canvas, and recording a third identification coordinate point of the scratched third part of image position on the first canvas;
drawing a first image, a second image and a third image on a first canvas, a second canvas and a third canvas respectively;
filling a second canvas drawn with a second image into the first canvas, and keeping the initial coordinate point of the second canvas coincident with a second identification coordinate point on the first canvas; filling a third canvas drawn with a third image into the first canvas, and keeping the initial coordinate point of the third canvas coincident with a third identification coordinate point on the first canvas to form a large image drawn on the same canvas;
and storing the first canvas output in a final BMP file to finish the output of the matted filling large-pixel image.
The invention adopts the method of drawing and supplementing on canvas with the same size to solve the problem that larger pixel pictures can not be drawn by adopting a common drawing method, and the method is simpler and more convenient in understanding and code realization and has a certain use value.
Drawings
Fig. 1 is a schematic diagram of a large image to be drawn.
FIG. 2 is a schematic diagram of a partial image location scratched out on a first canvas.
FIG. 3 is a schematic diagram of a first canvas of C++.
FIG. 4 is a schematic diagram of a second canvas of C++.
Fig. 5 is a schematic drawing of a first image on a first canvas.
FIG. 6 is a schematic drawing of a second image on a second canvas.
FIG. 7 is a schematic diagram of a large image supplementing a second image on a first canvas.
Fig. 8 is an image of a prior art drawing using c++. As can be seen, the second image is not completely drawn on the canvas.
Fig. 9 is a schematic diagram of another division of a large image to be drawn.
FIG. 10 is a schematic diagram of the second image of FIG. 9 drawn on a second canvas.
FIG. 11 is a schematic drawing of the third image divided in FIG. 9 on a third canvas.
Fig. 12 is a schematic diagram of a third division manner of a large image to be drawn.
FIG. 13 is a schematic drawing of the second image divided in FIG. 12 on a second canvas.
FIG. 14 is a schematic drawing of the third image divided in FIG. 12 on a third canvas.
In the figure: the first image 10, the second image 20, the first canvas 30, the second canvas 40, the partial image position 50, the second partial image position 60, the third partial image position 70, the second partial image position 601, the third partial image position 701.
Detailed Description
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Referring to fig. 1 to 7, an embodiment of the present invention provides a method for drawing a BMP-formatted image with large pixels, including the steps of:
pre-dividing the image to be drawn into a first image 10 and a second image 20;
establishing a first canvas 30;
establishing a second canvas 40, matting out the partial image position 50 occupied by the second image 20 on the first canvas 30, (namely, the second image 20 is a partial image which cannot be drawn on the first canvas 30) and storing the partial image position 50 on the second canvas 40, and recording the identification coordinate points A (Xa, ya) of the scratched partial image position 50 on the first canvas 30;
drawing the first image 10 and the second image 20 on the first canvas 30 and the second canvas 40, respectively;
filling a second canvas 40 drawn with a second image 20 into the first canvas 30, keeping the initial coordinate points B (Xb and Yb) of the second canvas 40 coincident with the identification coordinate points A (Xa and Ya) on the first canvas 30, and forming a large image drawn on the same canvas (namely the first canvas 30);
the output of the first canvas 30 is stored in the final BMP file, and the output of the matted filling large-pixel image is completed.
Further, the maximum side length of the first image and the second image is not greater than 60253/2. Because the maximum array which can be identified by the drawing program in the drawing tool used in the invention is 2 32 While the array occupies no more than 60253/2 in the canvas, the maximum side length of the divided image is limited to be no more than 60253/2 in order to avoid that the image cannot be displayed completely in the canvas.
Further, the coordinates of the identification coordinate points of the position of the scratched partial image on the first canvas are A (Xa, ya, W, H), wherein Xa and Ya are the coordinates of the X axis and the coordinates of the Y axis of the canvas respectively, W is the length of the scratched partial canvas, and H is the height of the scratched partial canvas so as to uniquely position the position and the outline of the scratched partial canvas.
Furthermore, the method of the invention can also carry out multi-block division on the large pixel image, wherein the multi-block division comprises division in the same direction and division in different directions. For example, the following improvement method is divided into the first one along the same direction, the second one along the different directions, and so on, and the method is suitable for drawing images in which larger images are divided into different directions and are divided into different properties.
Referring to fig. 9-11, the improvement method one: pre-dividing an image to be drawn into a first image, a second image and a third image; the dividing method is to divide the image along the X-axis direction.
Establishing a first canvas;
establishing a second canvas, establishing a third canvas, digging out a second part of image position 60 occupied by the second image on the first canvas, storing the second part of image position 60 on the second canvas, and recording second identification coordinate points C (Xc, yc) of the second part of image position which is dug out on the first canvas; a third part of image position 70 occupied by the third image is scratched out on the first canvas and stored on the third canvas, and third identification coordinate points D (Xd and Yd) of the scratched out third part of image position are recorded on the first canvas;
drawing a first image, a second image and a third image on a first canvas, a second canvas and a third canvas respectively;
filling a second canvas drawn with a second image into the first canvas, and keeping a starting coordinate point C' of the second canvas coincident with a second identification coordinate point C on the first canvas; filling a third canvas drawn with a third image into the first canvas, and keeping the initial coordinate point D' of the third canvas coincident with the third identification coordinate point D on the first canvas to form a large image drawn on the same canvas;
and storing the first canvas output in a final BMP file to finish the output of the matted filling large-pixel image.
Referring to fig. 12-14, the improvement method two: pre-dividing an image to be drawn into a first image, a second image and a third image; the dividing method is to divide the image along the X-axis and Y-axis directions.
Establishing a first canvas;
establishing a second canvas, establishing a third canvas, digging out a second part of image position 601 occupied by the second image on the first canvas, storing the second part of image position 601 on the second canvas, and recording second identification coordinate points C1 (Xc and Yc) of the second part of image position which is dug out on the first canvas; a third part of image position 701 occupied by the third image is scratched out on the first canvas and stored on the third canvas, and third identification coordinate points D1 (Xd and Yd) of the scratched out third part of image position are recorded on the first canvas;
drawing a first image, a second image and a third image on a first canvas, a second canvas and a third canvas respectively;
filling a second canvas drawn with a second image into the first canvas, and keeping a starting coordinate point C1' of the second canvas coincident with a second identification coordinate point C1 on the first canvas; filling a third canvas drawn with a third image into the first canvas, and keeping the initial coordinate point D1' of the third canvas coincident with the third identification coordinate point D1 on the first canvas to form a large image drawn on the same canvas;
and storing the first canvas output in a final BMP file to finish the output of the matted filling large-pixel image.
The modules or units in the device of the embodiment of the invention can be combined, divided and deleted according to actual needs.
The foregoing disclosure is illustrative of the preferred embodiments of the present invention, and is not to be construed as limiting the scope of the invention, as it is understood by those skilled in the art that all or part of the above-described embodiments may be practiced with equivalents thereof, which fall within the scope of the invention as defined by the appended claims.

Claims (4)

1. The drawing method of the large-pixel BMP format image is characterized by comprising the following steps of:
pre-dividing an image to be drawn into a first image and a second image;
establishing a first canvas and a second canvas;
digging out the position of the partial image occupied by the second image on the first canvas, storing the position of the partial image occupied by the second image on the second canvas, and recording the identification coordinate point of the position of the partial image which is dug out on the first canvas;
drawing a first image and a second image on a first canvas and a second canvas, respectively;
filling a second canvas drawn with a second image into the first canvas, and keeping the initial coordinate point of the second canvas coincident with the identification coordinate point on the first canvas to form a large image drawn on the same canvas;
storing the first canvas output in a final BMP file to finish the output of the matted filling large-pixel image;
the coordinates of the identification coordinate points of the positions of the partial images to be scratched are recorded on the first canvas as (Xa, ya, W, H), wherein Xa and Ya are the coordinates of the X axis and the coordinates of the Y axis of the canvas respectively, W is the length of the partial images to be scratched, and H is the height of the partial canvas to be scratched so as to uniquely position the positions and the outlines of the partial canvas to be scratched.
2. The method for drawing a large-pixel BMP-format image according to claim 1, wherein: the maximum side length of the first image and the second image is not greater than 60253/2.
3. The method for drawing a large-pixel BMP-format image according to claim 1, wherein:
pre-dividing an image to be drawn into a first image, a second image and a third image along the X-axis direction;
establishing a first canvas, establishing a second canvas and establishing a third canvas;
digging out the position of a second partial image occupied by the second image on the first canvas, storing the position of the second partial image on the second canvas, and recording a second identification coordinate point of the position of the second partial image which is dug out on the first canvas; digging out a third part of image position occupied by the third image on the first canvas, storing the third part of image position occupied by the third image on the third canvas, and recording a third identification coordinate point of the scratched third part of image position on the first canvas;
drawing a first image, a second image and a third image on a first canvas, a second canvas and a third canvas respectively;
filling a second canvas drawn with a second image into the first canvas, and keeping the initial coordinate point of the second canvas coincident with a second identification coordinate point on the first canvas; filling a third canvas drawn with a third image into the first canvas, and keeping the initial coordinate point of the third canvas coincident with a third identification coordinate point on the first canvas to form a large image drawn on the same canvas;
and storing the first canvas output in a final BMP file to finish the output of the matted filling large-pixel image.
4. The method for drawing a large-pixel BMP-format image according to claim 1, wherein:
pre-dividing an image to be drawn into a first image, a second image and a third image along the X-axis and Y-axis directions;
establishing a first canvas, establishing a second canvas and establishing a third canvas;
digging out the position of a second partial image occupied by the second image on the first canvas, storing the position of the second partial image on the second canvas, and recording a second identification coordinate point of the position of the second partial image which is dug out on the first canvas; digging out a third part of image position occupied by the third image on the first canvas, storing the third part of image position occupied by the third image on the third canvas, and recording a third identification coordinate point of the scratched third part of image position on the first canvas;
drawing a first image, a second image and a third image on a first canvas, a second canvas and a third canvas respectively;
filling a second canvas drawn with a second image into the first canvas, and keeping the initial coordinate point of the second canvas coincident with a second identification coordinate point on the first canvas; filling a third canvas drawn with a third image into the first canvas, and keeping the initial coordinate point of the third canvas coincident with a third identification coordinate point on the first canvas to form a large image drawn on the same canvas;
and storing the first canvas output in a final BMP file to finish the output of the matted filling large-pixel image.
CN201811135174.3A 2018-09-28 2018-09-28 Drawing method of large-pixel BMP format image Active CN109360253B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811135174.3A CN109360253B (en) 2018-09-28 2018-09-28 Drawing method of large-pixel BMP format image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811135174.3A CN109360253B (en) 2018-09-28 2018-09-28 Drawing method of large-pixel BMP format image

Publications (2)

Publication Number Publication Date
CN109360253A CN109360253A (en) 2019-02-19
CN109360253B true CN109360253B (en) 2023-08-11

Family

ID=65347930

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811135174.3A Active CN109360253B (en) 2018-09-28 2018-09-28 Drawing method of large-pixel BMP format image

Country Status (1)

Country Link
CN (1) CN109360253B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105809666A (en) * 2014-12-30 2016-07-27 联芯科技有限公司 Image matting method and device
CN106569805A (en) * 2016-10-21 2017-04-19 搜游网络科技(北京)有限公司 Canvas storage/graph drawing method and equipment
CN106780327A (en) * 2016-12-06 2017-05-31 掌阅科技股份有限公司 File fragmentation merging method, device and electronic equipment
CN106997348A (en) * 2016-01-22 2017-08-01 腾讯科技(深圳)有限公司 A kind of data method for drafting and device
WO2018107777A1 (en) * 2016-12-15 2018-06-21 威创集团股份有限公司 Method and system for annotating video image

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4130780B2 (en) * 2002-04-15 2008-08-06 松下電器産業株式会社 Image encoding method and image decoding method
US6930656B2 (en) * 2002-06-24 2005-08-16 Lin-Qing He Method of displaying multiple images formed from pixels
US20120246554A1 (en) * 2011-03-23 2012-09-27 Ericom Software Ltd. Performing binary composition of images onto an html canvas element

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105809666A (en) * 2014-12-30 2016-07-27 联芯科技有限公司 Image matting method and device
CN106997348A (en) * 2016-01-22 2017-08-01 腾讯科技(深圳)有限公司 A kind of data method for drafting and device
CN106569805A (en) * 2016-10-21 2017-04-19 搜游网络科技(北京)有限公司 Canvas storage/graph drawing method and equipment
CN106780327A (en) * 2016-12-06 2017-05-31 掌阅科技股份有限公司 File fragmentation merging method, device and electronic equipment
WO2018107777A1 (en) * 2016-12-15 2018-06-21 威创集团股份有限公司 Method and system for annotating video image

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Qt超大像素图绘制技术方案;软件自由职业者;《https://zhuanlan.zhihu.com/p/37864481》;20180608;第1-2页 *

Also Published As

Publication number Publication date
CN109360253A (en) 2019-02-19

Similar Documents

Publication Publication Date Title
CN110648397B (en) Scene map generation method and device, storage medium and electronic equipment
CN110717494B (en) Android mobile terminal indoor scene three-dimensional reconstruction and semantic segmentation method
WO2019042426A1 (en) Augmented reality scene processing method and apparatus, and computer storage medium
JPH0816783A (en) Device and method for processing image
CN101930620A (en) Image processing method and associated apparatus for rendering three-dimensional effect using two-dimensional image
CN109816730A (en) Workpiece grabbing method, apparatus, computer equipment and storage medium
WO2014110954A1 (en) Method, device and computer-readable storage medium for panoramic image completion
CN112348958A (en) Method, device and system for acquiring key frame image and three-dimensional reconstruction method
US10798300B2 (en) Method and device for unfolding lens image into panoramic image
US20170358056A1 (en) Image generation device, coordinate converison table creation device and creation method
JP4649559B2 (en) 3D object recognition apparatus, 3D object recognition program, and computer-readable recording medium on which the same is recorded
CN109427040B (en) Image processing apparatus and method
CN107203961B (en) Expression migration method and electronic equipment
JP6311372B2 (en) Image processing apparatus and image processing method
CN106780704B (en) The direct lighting effect proximity rendering method of three-dimensional scenic reused based on visibility
US11138743B2 (en) Method and apparatus for a synchronous motion of a human body model
CN109360253B (en) Drawing method of large-pixel BMP format image
CN111914046B (en) Generation method and device of target seating chart and computer equipment
CN110910484A (en) SLAM-based object mapping method from two-dimensional image to three-dimensional real scene
CN105279785A (en) Display platform three-dimensional modeling method and device
CN104103035A (en) Three-dimensional model scaling method
CN113256484B (en) Method and device for performing stylization processing on image
CN106780693B (en) Method and system for selecting object in three-dimensional scene through drawing mode
US11120606B1 (en) Systems and methods for image texture uniformization for multiview object capture
CN111652023B (en) Mouth-type adjustment and live broadcast method and device, electronic equipment and storage medium

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
TA01 Transfer of patent application right

Effective date of registration: 20230720

Address after: 750021 the Ningxia Hui Autonomous Region Yinchuan Yinchuan economic and Technological Development Zone ningshuo South Street No. 298

Applicant after: KOCEL INTELLIGENT EQUIPMENT Co.,Ltd.

Address before: 750021 science and technology building and office building of small and medium-sized enterprise entrepreneurship base in Yinchuan economic and Technological Development Zone, No. 330 Huanghe Road, Xixia District, Yinchuan City, Ningxia Hui Autonomous Region

Applicant before: NATIONAL INTELLIGENT FOUNDRY INDUSTRY INNOVATION CENTER

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant