Summary of the invention
Based on this, it is necessary to exist for the mapping software in the prior art big pixel picture of processing and be difficult to disposably drawComplete problem provides a kind of simple, convenient processing method that can be realized big pixel picture and draw.
A kind of processing method for drawing big pixel picture, the treating method comprises following steps: according to drafting picturePicture segmentation is several painting canvas that can completely draw picture by size;Calculate the coordinate origin of picture and practical big figure after dividingThe offset distance of coordinate origin;Local image where successively drawing each painting canvas, and BMP formatted file is generated respectively;Load each instituteState the data of BMP file, and by each final picture file format of BMP file format Integration obtaining;Intercept each BMP fileBitmap data, and splice each section bitmap data;Default picture head and spliced bitmap data are exported, and are saved in mostWhole BMP file completes picture mosaic output.
It is divided into several pictures that program can completely be drawn respectively for picture is drawn along short transverse in one of the embodiments,Cloth.
The offset distance is obtained using coordinate origin offset method in one of the embodiments,.
Update is further comprised the steps of: before the step of splicing each section bitmap data most in one of the embodiments,The actual height of whole picture file format.
Splice the bitmap data of 23-26 Bitmap Height in one of the embodiments, and judges whether bitmap data is positiveNumber, if then data content to be merged to last figure inverted order;Otherwise by each picture by first figure sequence by data contentMerge.
In one of the embodiments, the BMP file include BMP file header, message bit pattern head, palette information andBitmap data.
The length of the BMP file header is 14 bytes in one of the embodiments,.
The BMP file header includes BMP file type, file size and bitmap starting in one of the embodiments,Location information.
The length of institute's bitmap information head is 40 bytes in one of the embodiments, for illustrating that the size of bitmap is believedBreath.
In one of the embodiments, in the step of bitmap data of each BMP file of the interception the following steps are included:Each bitmap data is intercepted according to the offset that 11-14 byte parses.
The processing method of the above-mentioned big pixel picture of drafting, can be complete by basic algorithm by resolving into big BMP pictureIn each section after disassembly, by it in the practical big upper corresponding position of figure, it is right to draw out the decomposition part for the multi-section of drafting pointThe specific image answered, then output is saved into BMP file, is handled finally by file data, and parsing merges the BMP of all decompositionFile simultaneously obtains final big pixel picture.By above-mentioned jigsaw method be able to solve using common drawing practice cannot draw it is largerThe problem of pixel picture, and the processing method is understanding and code is realized upper relatively simple, conveniently, there is certain use value.
Specific embodiment
To facilitate the understanding of the present invention, a more comprehensive description of the invention is given in the following sections with reference to the relevant attached drawings.In attached drawingGive better embodiment of the invention.But the invention can be realized in many different forms, however it is not limited to hereinDescribed embodiment.On the contrary, the purpose of providing these embodiments is that making to understand more the disclosureAdd thorough and comprehensive.
Unless otherwise defined, all technical and scientific terms used herein and belong to technical field of the inventionThe normally understood meaning of technical staff is identical.Term as used herein in the specification of the present invention is intended merely to description toolThe purpose of the embodiment of body, it is not intended that in the limitation present invention.Term " and or " used herein includes one or moreAny and all combinations of relevant listed item.
In one embodiment, a kind of processing method for drawing big pixel picture, the treating method comprises following steps:It is several painting canvas that can completely draw picture by picture segmentation according to the size for drawing picture;Calculate the coordinate of picture after dividingThe offset distance of origin and practical big figure coordinate origin;Local image where successively drawing each painting canvas, and BMP format is generated respectivelyFile;Load the data of each BMP file, and by each final picture file format of BMP file format Integration obtaining;It cutsThe bitmap data of each BMP file is taken, and each bitmap number is intercepted according to the offset that 11-14 byte parses in bitmap dataAccording to;The actual height of final picture file format is updated, and splices each section bitmap data;By default picture head and splicedBitmap data output, and it is saved in final BMP file;The intermediate each fractionation picture exported is deleted, picture mosaic output is completed.
The processing method of the above-mentioned big pixel picture of drafting, can be complete by basic algorithm by resolving into big BMP pictureIn each section after disassembly, by it in the practical big upper corresponding position of figure, it is right to draw out the decomposition part for the multi-section of drafting pointThe specific image answered, then output is saved into BMP file, is handled finally by file data, and parsing merges the BMP of all decompositionFile simultaneously obtains final big pixel picture.By above-mentioned jigsaw method be able to solve using common drawing practice cannot draw it is largerThe problem of pixel picture, and the processing method is understanding and code is realized upper relatively simple, conveniently, there is certain use value.
The processing method for drawing big pixel picture is illustrated combined with specific embodiments below, to further understandThe inventive concept of the processing method for drawing big pixel picture.
Referring to Fig. 1, a kind of processing method for drawing big pixel picture, the treating method comprises following steps:
S101: being several painting canvas that can completely draw picture by picture segmentation according to the size for drawing picture;
In one embodiment, it is divided into several painting canvas that program can completely be drawn respectively for picture is drawn along short transverse.I.e.By the way that big pixel picture is divided into several fractions along its short transverse (Y-direction), each section can be completely plotted in oneIt is in a painting canvas, i.e., final combined and spliced at a complete big pixel picture by several painting canvas.
S102: the coordinate origin of picture and the offset distance of practical big figure coordinate origin after segmentation are calculated;
In one embodiment, the offset distance is obtained using coordinate origin offset method.The coordinate of picture after dividingOrigin and the offset distance of practical big figure coordinate origin are measured using coordinate origin offset method.The image saved is exported so justIt is the partitioning portion of relatively practical big figure.
S103: successively drawing local image where each painting canvas, and generates BMP formatted file respectively;
It is respectively corresponded on each painting canvas and draws each local image, then respectively corresponded and generate BMP formatted file.SpecificallyGround, in one embodiment, the BMP file include BMP file header, message bit pattern head, palette information and bitmap numberAccording to.Specifically, the length of the BMP file header is 14 bytes.In one embodiment, the BMP file header includes BMP textPart type, file size and bitmap start position information.In one embodiment, the length of institute's bitmap information head is 40Byte, for illustrating the dimension information of bitmap.In one embodiment, the palette information, for illustrating in bitmapColor.In one embodiment, institute's bit-map data, for recording each pixel value of bitmap.
S104: the data of each BMP file of load, and each final picture of BMP file format Integration obtaining is literaryPart format;
It is wherein described below for integrating the significant data in BMP format procedure: 1-2: image file head (number hereWhat word represented is byte, similarly hereinafter), 0x4d42=" BM ", expression is the BMP format that Windows is supported;3-6: entire file is bigIt is small;7-8: retaining, it is necessary to be set as 0;9-10: retaining, it is necessary to be set as 0;11-14: to bitmap number since fileOffset (14+40+4*(2^biBitCount) between);15-18: message bit pattern head length;19-22: bitmap is wideDegree, as unit of pixel;23-26: Bitmap Height, as unit of pixel.The non-analytic modification of remainder data is not done in detail hereinExplanation.
S105: the bitmap data of each BMP file is intercepted, and splices each section bitmap data;
In one embodiment, each bitmap data is intercepted according to the offset that 11-14 byte parses.I.e. to each describedThe offset that 11-14 byte parses in the bitmap data of BMP file, to obtain the data of each bitmap.
In one embodiment, it is final that update is further comprised the steps of: before the step of splicing each section bitmap dataThe actual height of picture file format.Specifically, because the corresponding bitmap developed width of horizontal partition 19-22 byte does not need to repairChange, therefore the corresponding height of 23-26 byte is updated to each segmentation Bitmap Height summation.
It should be noted that being updated when splicing each section bitmap data only for the corresponding height of 23-26 byteAt each segmentation Bitmap Height summation.In one embodiment, splice the bitmap data of 23-26 Bitmap Height, and judge bitmapWhether data are positive number, if then data content to be merged to last figure inverted order;Otherwise each picture is suitable by first figureSequence merges data content.That is 23-26 Bitmap Height seems to swing to if it is positive number explanatory diagram, if the value is a negativeExplanatory diagram seems positive.It needs to merge from last figure inverted order by data content if swinging to;If it is justTo then needing to be merged together from first sequence by data content.
S106: default picture head and spliced bitmap data being exported, and are saved in final BMP file, complete to spellFigure output.
In one embodiment, it is further comprised the steps of: before the step of completion picture mosaic output and deletes intermediate outputIt is each to split picture.That is, fractionation picture in the process is deleted when exporting final picture mosaic.It can avoid splitting picture in this wayInfluence final picture mosaic output effect.
The processing method of the above-mentioned big pixel picture of drafting, can be complete by basic algorithm by resolving into big BMP pictureIn each section after disassembly, by it in the practical big upper corresponding position of figure, it is right to draw out the decomposition part for the multi-section of drafting pointThe specific image answered, then output is saved into BMP file, is handled finally by file data, and parsing merges the BMP of all decompositionFile simultaneously obtains final big pixel picture.By above-mentioned jigsaw method be able to solve using common drawing practice cannot draw it is largerThe problem of pixel picture, and the processing method is understanding and code is realized upper relatively simple, conveniently, there is certain use value.
Each technical characteristic of embodiment described above can be combined arbitrarily, for simplicity of description, not to above-mentioned realityIt applies all possible combination of each technical characteristic in example to be all described, as long as however, the combination of these technical characteristics is not depositedIn contradiction, all should be considered as described in this specification.
The embodiments described above only express several embodiments of the present invention, and the description thereof is more specific and detailed, but simultaneouslyIt cannot therefore be construed as limiting the scope of the patent.It should be pointed out that coming for those of ordinary skill in the artIt says, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to protection of the inventionRange.Therefore, the scope of protection of the patent of the invention shall be subject to the appended claims.