CN107146270A - A kind of pattern drawing method and device - Google Patents
A kind of pattern drawing method and device Download PDFInfo
- Publication number
- CN107146270A CN107146270A CN201710230818.6A CN201710230818A CN107146270A CN 107146270 A CN107146270 A CN 107146270A CN 201710230818 A CN201710230818 A CN 201710230818A CN 107146270 A CN107146270 A CN 107146270A
- Authority
- CN
- China
- Prior art keywords
- pixel
- color
- graphing
- mask
- relevant position
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/40—Filling a planar surface by adding surface attributes, e.g. colour or texture
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Image Generation (AREA)
Abstract
This application discloses a kind of pattern drawing method and device.According to treating multiple pixels that graphing is included, for the pixel of each position, obtain the color of the pixel of the relevant position of mask figure corresponding with treating graphing, determined whether to draw the pixel of the position according to the color of acquisition, equivalent to controlling to treat the graphing part to be shown by mask figure, treat that graphing is corresponding with mask figure, if graphing is treated in replacing, only needing to renewal mask figure just can be with so as to realize in software interface simplicity, easily carries out graphic plotting.
Description
Technical field
The present invention relates to computer realm, more particularly to a kind of graphics plotting of software interface.
Background technology
The software interface of present computer is extremely important, shows the control and picture of irregular figure also increasingly on interface
It is many, such as picture of eyes.We need to draw out any one regional graphics inside a picture, rather than will be all
Figure all draw out.For example, irregular figure as shown in Figure 1 draws design sketch, a figure for having Fig. 1 left sides
Eye.bmp, then we the eyes of the inside are plotted on interface, realize on the right of Fig. 1 shown in effect, only draw eyes, ash
The background of color all should not.Existing frequently-used implementation method typically has two kinds:
A kind of is to make eyes peripheral part in rectangular control, figure to be all drawn as the color as background colour, so
Seem to be equivalent to only see an irregular graphical control, but so have a problem, be exactly as user behaviour
When work around this irregular figure, this control still can be triggered, because the scope of this control is whole rectangle
Region.Specifically in this example, the schematic diagram of a kind of drafting irregular figure of prior art as shown in Figure 2, by Fig. 2 left sides
The gray background of eyes makes the background at interface into figure, such as white, as shown in the figure of Fig. 2 centre, then draws again,
The figure on the right of Fig. 2 is obtained, thus can't see background is grey.But so can be problematic, work as interface
When background changes, white background is shown again.Design sketch after Fig. 2 median surfaces background change as shown in Figure 3,
It is thus very bad.
Another is when this control is drawn, only to be painted out not in code by Pictures location region is detailed
Eye portion in regular figure, such as Fig. 1, but this method also has bad place, exactly if changing a picture,
Code must be write again, because content irregular area is different in each picture.
It would therefore be highly desirable to provide a kind of simply and easily graphic plotting scheme.
The content of the invention
The application provides a kind of pattern drawing method and device, to realize in software interface simplicity, easily carry out figure
Draw.
On the one hand there is provided a kind of pattern drawing method, including:
According to multiple pixels that graphing is included are treated, for the pixel of each position, acquisition is waited to draw with described
The color of the pixel of the relevant position of the corresponding mask figure of figure;
If the color of the pixel of the relevant position of the mask figure obtained is the first setpoint color, do not draw described
The pixel of position;
If the color of the pixel of the relevant position of the mask figure obtained is the second setpoint color, institute's rheme is drawn
The pixel put.
In one implementation, it is described to treat that graphing is irregular figure.
In another implementation, the picture of the acquisition and the relevant position for treating the corresponding mask figure of graphing
The color of vegetarian refreshments, including:
Read the value with the color of the pixel of the relevant position for treating the corresponding mask figure of graphing;
Wherein, the value of the color of the pixel of the relevant position of the mask figure is set including the first setpoint color value and second
Determine color value.
In another implementation, first setpoint color is white, and the second setpoint color is black.
In another implementation, the picture of the acquisition and the relevant position for treating the corresponding mask figure of graphing
Before the color of vegetarian refreshments, methods described also includes:
Storage treats the corresponding mask figure of graphing with described.
On the other hand there is provided a kind of graphics rendering device, including:
Acquiring unit, for according to multiple pixels that graphing is included are treated, for the pixel of each position, is obtained
With the color of the pixel of the relevant position for treating the corresponding mask figure of graphing;
Drawing unit, if the color of the pixel of the relevant position of the mask figure obtained for the acquiring unit is
First setpoint color, then do not draw the pixel of the position;
If the drawing unit is additionally operable to the pixel of the relevant position for the mask figure that the acquiring unit is obtained
Color is the second setpoint color, then draws the pixel of the position.
In one implementation, it is described to treat that graphing is irregular figure.
In another implementation, the acquiring unit specifically for:
Read the value with the color of the pixel of the relevant position for treating the corresponding mask figure of graphing;
Wherein, the value of the color of the pixel of the relevant position of the mask figure is set including the first setpoint color value and second
Determine color value.
In another implementation, first setpoint color is white, and the second setpoint color is black.
In another implementation, described device also includes:
Memory cell, the corresponding mask figure of graphing is treated for storing with described.
A kind of pattern drawing method and device provided using the application, is had the advantages that:
According to multiple pixels that graphing is included are treated, for the pixel of each position, graphing is obtained and treated
The color of the pixel of the relevant position of corresponding mask figure, determines whether to draw the pixel of the position according to the color of acquisition
Point, equivalent to controlling to treat the graphing part to be shown by mask figure, treats that graphing is corresponding with mask figure, if more
Change and treat graphing, it is only necessary to which updating mask figure just can be with so as to realize in software interface simplicity, easily schemed
Shape is drawn.
Brief description of the drawings
Fig. 1 draws design sketch for the irregular figure of example;
Fig. 2 is a kind of schematic diagram of drafting irregular figure of prior art;
Fig. 3 is the design sketch after Fig. 2 median surfaces background changes;
Fig. 4 is a kind of schematic flow sheet of pattern drawing method provided in an embodiment of the present invention;
The schematic diagram for the irregular figure that Fig. 5 draws for the image drawing method of the use embodiment of the present invention of example;
Fig. 6 is a kind of module diagram of image plotting device provided in an embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation is described.
Referring to Fig. 4, Fig. 4 is a kind of schematic flow sheet of pattern drawing method provided in an embodiment of the present invention, this method
Comprise the following steps:
S101, stores mask figure corresponding with treating graphing.
In the present embodiment, each treats that graphing has corresponding mask figure, is prestored before graphic plotting is carried out
Mask figure corresponding with treating graphing.The step is optional step, connects other steps with dotted line in figure.It may be appreciated
It is that can not also prestore the mask figure, mask figure corresponding with currently treating graphing can be obtained from network etc. in real time.
S102, multiple pixels that graphing is included are treated according to described, for the pixel of each position, are obtained and institute
State the color of the pixel for the relevant position for treating the corresponding mask figure of graphing.
S103, if the color of the pixel of the relevant position of the mask figure obtained is the first setpoint color, is not painted
Make the pixel of the position.
S104, if the color of the pixel of the relevant position of the mask figure obtained is the second setpoint color, draws
The pixel of the position.
Picture has size, such as 48*48 has just represented 48 rows, and often row has 48 pixels, i.e., one to treat graphing bag
Containing multiple pixels.On software interface when graphing, the pixel for the position treated on graphing is often drawn
When, just go to read the color of relevant position pixel in mask figure, if the first setpoint color, such as white, then this position
Pixel just do not draw out, if the second setpoint color, such as black, then the pixel of this position is drawn out
Come, thus equivalent to controlling original to treat the graphing part to be shown by mask figure.Alternatively, first setting
Color is white, and mask figure sheet is as white, then also illustrating that the pixel of the position need not draw, and second setpoint color is
Black.Certainly, the first setpoint color and the second setpoint color can also be other colors, according to pre-setting really for system
It is fixed.Alternatively, this treats that graphing is irregular figure.
The corresponding mask figure of drawing image is treated due to having prestored, therefore, step S102 can also be:Read with it is described
Treat the value of the color of the pixel of the relevant position of the corresponding mask figure of graphing;
Wherein, the value of the color of the pixel of the relevant position of the mask figure is set including the first setpoint color value and second
Determine color value.
By taking the schematic diagram for the irregular figure that the image drawing method of the use embodiment of the present invention of Fig. 5 examples is drawn as an example
It is explained in further detail.We are plotted to the eyes of left figure in Fig. 5 on software interface, realize in Fig. 5 shown in right figure
Effect, only draw eyes, the background of grey all should not, then when often drawing a pixel in Fig. 5 in left figure, just go interpreting blueprints 5
The color of middle mask figure relevant position pixel, if white, then this pixel is not just drawn in Fig. 5 right figures,
If black just draws.All pixels point Deng the eyes is all according to the step, one by one with mask figure relevant position picture
The color of vegetarian refreshments compares and drafting is finished, then the eyes, and the background without grey are just delineated on software interface.
If original treats that graphing is changed, it is only necessary to which providing a newest mask figure just can be with very square
Just.
A kind of pattern drawing method provided according to embodiments of the present invention, according to treating multiple pixels that graphing is included
Point, for the pixel of each position, obtains the color of the pixel of the relevant position of mask figure corresponding with treating graphing,
Determined whether to draw the pixel of the position according to the color of acquisition, equivalent to controlling to treat that graphing will show by mask figure
The part shown, treats that graphing is corresponding with mask figure, and graphing is treated if changed, it is only necessary to which updating mask figure just can be with,
So as to realize in software interface simplicity, easily carry out graphic plotting.
Referring to Fig. 6, Fig. 6 is a kind of module diagram of image plotting device provided in an embodiment of the present invention.The device
1000 include:
Memory cell 11, for storing mask figure corresponding with treating graphing.
In the present embodiment, each treats that graphing has corresponding mask figure, is prestored before graphic plotting is carried out
Mask figure corresponding with treating graphing.The memory cell 11 is optional module, connects other modules with dotted line in figure.Can be with
Understand, the mask figure can not also be prestored, can be obtained in real time from network etc. with currently treating that graphing is corresponding
Mask figure.
Acquiring unit 12, for treating multiple pixels that graphing is included according to, for the pixel of each position
Point, obtains the color with the pixel of the relevant position for treating the corresponding mask figure of graphing.
Drawing unit 13, if the color of the pixel of the relevant position of the mask figure obtained for the acquiring unit
For the first setpoint color, then the pixel of the position is not drawn.
If the drawing unit 13 is additionally operable to the pixel of the relevant position for the mask figure that the acquiring unit is obtained
Color be the second setpoint color, then draw the pixel of the position.
Picture has size, such as 48*48 has just represented 48 rows, and often row has 48 pixels, i.e., one to treat graphing bag
Containing multiple pixels.On software interface when graphing, the pixel for the position treated on graphing is often drawn
When, just go to read the color of relevant position pixel in mask figure, if the first setpoint color, such as white, then this position
Pixel just do not draw out, if the second setpoint color, such as black, then the pixel of this position is drawn out
Come, thus equivalent to controlling original to treat the graphing part to be shown by mask figure.Alternatively, first setting
Color is white, and mask figure sheet is as white, then also illustrating that the pixel of the position need not draw, and second setpoint color is
Black.Certainly, the first setpoint color and the second setpoint color can also be other colors, according to pre-setting really for system
It is fixed.Alternatively, this treats that graphing is irregular figure.
The corresponding mask figure of drawing image is treated due to having prestored, therefore, acquiring unit 12 can also be specifically for:Read
Take the value with the color of the pixel of the relevant position for treating the corresponding mask figure of graphing;
Wherein, the value of the color of the pixel of the relevant position of the mask figure is set including the first setpoint color value and second
Determine color value.
If original treats that graphing is changed, it is only necessary to which providing a newest mask figure just can be with very square
Just.
A kind of graphics rendering device provided according to embodiments of the present invention, according to treating multiple pixels that graphing is included
Point, for the pixel of each position, obtains the color of the pixel of the relevant position of mask figure corresponding with treating graphing,
Determined whether to draw the pixel of the position according to the color of acquisition, equivalent to controlling to treat that graphing will show by mask figure
The part shown, treats that graphing is corresponding with mask figure, and graphing is treated if changed, it is only necessary to which updating mask figure just can be with,
So as to realize in software interface simplicity, easily carry out graphic plotting.
It should be noted that for foregoing each method embodiment, in order to be briefly described, therefore it is all expressed as a series of
Combination of actions, but those skilled in the art should know, the present invention is not limited by described sequence of movement because
According to the present invention, some steps can be carried out sequentially or simultaneously using other.
In the above-described embodiments, the description to each embodiment all emphasizes particularly on different fields, and does not have the portion being described in detail in some embodiment
Point, it may refer to the associated description of other embodiment.
Through the above description of the embodiments, it is apparent to those skilled in the art that the present invention can be with
Realized with hardware, or firmware is realized, or combinations thereof mode is realized.When implemented in software, can be by above-mentioned functions
It is stored in computer-readable medium or is transmitted as one or more instructions on computer-readable medium or code.Meter
Calculation machine computer-readable recording medium includes computer-readable storage medium and communication media, and wherein communication media includes being easy to from a place to another
Any medium of individual place transmission computer program.Storage medium can be any usable medium that computer can be accessed.With
Exemplified by this but it is not limited to:Computer-readable medium can include random access memory (Random Access Memory,
RAM), read-only storage (Read-Only Memory, ROM), EEPROM (Electrically
Erasable Programmable Read-Only Memory, EEPROM), read-only optical disc (Compact Disc Read-
Only Memory, CD-ROM) or other optical disc storages, magnetic disk storage medium or other magnetic storage apparatus or can be used in
Carry or storage with instruction or data structure form desired program code and can by computer access any other
Medium.In addition.Any connection can be suitably turn into computer-readable medium.If for example, software is to use coaxial cable, light
Fine optical cable, twisted-pair feeder, Digital Subscriber Line (Digital Subscriber Line, DSL) or such as infrared ray, radio and
The wireless technology of microwave etc is transmitted from website, server or other remote sources, then coaxial cable, optical fiber cable, double
The wireless technology of twisted wire, DSL or such as infrared ray, wireless and microwave etc be included in belonging to medium it is fixing in.Such as this hair
Used in bright, disk (Disk) and dish (disc) include compressing laser disc (CD), laser disc, laser disc, Digital Versatile Disc (DVD),
Floppy disk and Blu-ray Disc, the replicate data of the usual magnetic of which disk, and dish is then with laser come optical replicate data.Group above
Conjunction should also be as being included within the protection domain of computer-readable medium.
Claims (10)
1. a kind of pattern drawing method, it is characterised in that including:
According to multiple pixels that graphing is included are treated, for the pixel of each position, obtain and treat graphing with described
The color of the pixel of the relevant position of corresponding mask figure;
If the color of the pixel of the relevant position of the mask figure obtained is the first setpoint color, the position is not drawn
Pixel;
If the color of the pixel of the relevant position of the mask figure obtained is the second setpoint color, the position is drawn
Pixel.
2. the method as described in claim 1, it is characterised in that described to treat that graphing is irregular figure.
3. the method as described in claim 1, it is characterised in that the acquisition and the graphing corresponding mask figure treated
The color of the pixel of relevant position, including:
Read the value with the color of the pixel of the relevant position for treating the corresponding mask figure of graphing;
Wherein, the value of the color of the pixel of the relevant position of the mask figure includes the first setpoint color value and the second setting face
Colour.
4. method as claimed in claim 3, it is characterised in that first setpoint color is white, the second setpoint color is
Black.
5. the method as described in claim any one of 1-4, it is characterised in that the acquisition treats that graphing is corresponding with described
Before the color of the pixel of the relevant position of mask figure, in addition to:
Storage treats the corresponding mask figure of graphing with described.
6. a kind of graphics rendering device, it is characterised in that including:
Acquiring unit, for according to multiple pixels that graphing is included are treated, for the pixel of each position, is obtained and institute
State the color of the pixel for the relevant position for treating the corresponding mask figure of graphing;
Drawing unit, if the color of the pixel of the relevant position of the mask figure obtained for the acquiring unit is first
Setpoint color, then do not draw the pixel of the position;
If the drawing unit is additionally operable to the color of the pixel of the relevant position for the mask figure that the acquiring unit is obtained
For the second setpoint color, then the pixel of the position is drawn.
7. device as claimed in claim 6, it is characterised in that described to treat that graphing is irregular figure.
8. device as claimed in claim 6, it is characterised in that the acquiring unit specifically for:
Read the value with the color of the pixel of the relevant position for treating the corresponding mask figure of graphing;
Wherein, the value of the color of the pixel of the relevant position of the mask figure includes the first setpoint color value and the second setting face
Colour.
9. device as claimed in claim 8, it is characterised in that first setpoint color is white, the second setpoint color is
Black.
10. the device as described in claim any one of 6-9, it is characterised in that also include:
Memory cell, the corresponding mask figure of graphing is treated for storing with described.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710230818.6A CN107146270A (en) | 2017-04-11 | 2017-04-11 | A kind of pattern drawing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710230818.6A CN107146270A (en) | 2017-04-11 | 2017-04-11 | A kind of pattern drawing method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107146270A true CN107146270A (en) | 2017-09-08 |
Family
ID=59774601
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710230818.6A Pending CN107146270A (en) | 2017-04-11 | 2017-04-11 | A kind of pattern drawing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107146270A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108449590A (en) * | 2018-03-30 | 2018-08-24 | 盎锐(上海)信息科技有限公司 | Image processing method and device |
WO2022022260A1 (en) * | 2020-07-30 | 2022-02-03 | 北京达佳互联信息技术有限公司 | Image style transfer method and apparatus therefor |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090154807A1 (en) * | 2005-12-30 | 2009-06-18 | Telecom Italia S.P.A. | Edge Comparison in Segmentation of Video Sequences |
CN102411791A (en) * | 2010-09-19 | 2012-04-11 | 三星电子(中国)研发中心 | Method and equipment for dynamic still image |
CN103366364A (en) * | 2013-06-07 | 2013-10-23 | 太仓中科信息技术研究院 | Color difference-based image matting method |
CN105184787A (en) * | 2015-08-31 | 2015-12-23 | 广州市幸福网络技术有限公司 | Identification camera capable of automatically carrying out portrait cutout and method thereof |
-
2017
- 2017-04-11 CN CN201710230818.6A patent/CN107146270A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090154807A1 (en) * | 2005-12-30 | 2009-06-18 | Telecom Italia S.P.A. | Edge Comparison in Segmentation of Video Sequences |
CN102411791A (en) * | 2010-09-19 | 2012-04-11 | 三星电子(中国)研发中心 | Method and equipment for dynamic still image |
CN103366364A (en) * | 2013-06-07 | 2013-10-23 | 太仓中科信息技术研究院 | Color difference-based image matting method |
CN105184787A (en) * | 2015-08-31 | 2015-12-23 | 广州市幸福网络技术有限公司 | Identification camera capable of automatically carrying out portrait cutout and method thereof |
Non-Patent Citations (2)
Title |
---|
李梅莲等: "基于VC++实现位图显示透明效果", 《许昌学院学报》 * |
陈晓龙等: "基于虚拟仪器的彩色图像单色背景透明化处理", 《国外电子测量技术》 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108449590A (en) * | 2018-03-30 | 2018-08-24 | 盎锐(上海)信息科技有限公司 | Image processing method and device |
CN108449590B (en) * | 2018-03-30 | 2020-02-11 | 盎锐(上海)信息科技有限公司 | Image processing method and device |
WO2022022260A1 (en) * | 2020-07-30 | 2022-02-03 | 北京达佳互联信息技术有限公司 | Image style transfer method and apparatus therefor |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
DE112013007658B4 (en) | Share storage over a unified storage architecture | |
US8237710B1 (en) | Methods and apparatus for fill rule evaluation over a tessellation | |
DE112011103209B4 (en) | METHOD, DEVICE AND SYSTEM FOR CONTROLLING DISPLAY ACTIVITY | |
US8572501B2 (en) | Rendering graphical objects based on context | |
CN116052605A (en) | Ink screen refreshing method and device, ink screen equipment and storage medium | |
CN112686939B (en) | Depth image rendering method, device, equipment and computer readable storage medium | |
CN107146270A (en) | A kind of pattern drawing method and device | |
CN109255763A (en) | Image processing method, device, equipment and storage medium | |
CN106605211A (en) | Render-Time Linking of Shaders | |
CN108959201A (en) | The method for drafting and E-book reader of E-book reader handwriting | |
CN111833417A (en) | Method and system for realizing black and white mode of android application program | |
CN108762597A (en) | The method for drafting and E-book reader of E-book reader handwriting | |
CN107133909A (en) | A kind of method and device of tinter restructuring | |
CN108810648A (en) | A kind of method and terminal carrying out image procossing | |
CN113409465A (en) | Method and device for generating hair model, storage medium and electronic equipment | |
CN107092413A (en) | A kind of visible controls corners processing method and system | |
CN108154463B (en) | Method for managing modeled GPU (graphics processing Unit) video memory system | |
CN107391148B (en) | View element saving method and device, electronic equipment and computer storage medium | |
CN109416828A (en) | Frame buffering is mapped to the device and method of logic eye | |
CN115909980B (en) | Text display optimization method, device, equipment and storage medium | |
US20230252715A1 (en) | Image processing method, apparatus and device and storage medium | |
CN111063309A (en) | Method for refreshing irregular graph conflict, storage device and display terminal | |
CN116415000A (en) | Visual knowledge graph configuration method, device, equipment and storage medium | |
CN116483359B (en) | New mimicry drawing method and device, electronic equipment and readable storage medium | |
JP7498238B2 (en) | Techniques for reducing distractions in images |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170908 |