A kind of camera system of real-time loading pinup picture element
Technical field
The present invention relates to mobile terminal shooting technology field, be specifically related to a kind of camera system of real-time loading pinup picture element.
Background technology
Under normal circumstances, comparison film to carry out pinup picture, need user first to take pictures generating pictures, then edit picture, selected pinup picture region is synthesized to pinup picture on former picture again.Such operation is more loaded down with trivial details, user cannot take pictures find a view time live preview and the position of selected pinup picture.
Summary of the invention
Object of the present invention, overcomes the deficiencies in the prior art exactly, provides a kind of pinup picture of taking pictures of live preview, can select pinup picture element and pinup picture region when taking pictures and finding a view, and the camera system of the real-time loading pinup picture element of live preview pinup picture effect.
In order to achieve the above object, adopt following technical scheme: a kind of camera system of real-time loading pinup picture element, described system comprises:
Taking pictures preview area, to find a view content for showing camera in real time;
Pinup picture mask layer, for loading pinup picture element;
Described pinup picture mask layer hides above preview area of taking pictures, and the click of response pinup picture element is selected or editor's event;
Photo generation unit, for generating the photo with pinup picture element;
When event is taken pictures in triggering, the size of the current pinup picture element of described pinup picture mask layer record and position data, and feed back to photo generation unit;
Photo generation unit uses the view data of the current preview area of taking pictures of camera interface acquisition and is loaded in internal memory becomes bitmap object;
Photo generation unit, according to the size of pinup picture element and position data, by pinup picture element and bitmap object composograph, and saves as picture format file.
Further, described pinup picture element is png picture format.
Further, described pinup picture mask layer is ImageView control, and control hides above preview area of taking pictures.
Further, described pinup picture mask layer is provided with pinup picture selective listing, and the preset multiple pinup picture element of pinup picture selective listing is selected for user.
Preferably, described pinup picture selective listing uses ListView control exposure pinup picture element, and responds user and click and select pinup picture elementary event.
Further, editor's event of described pinup picture mask layer response comprises moving event, convergent-divergent event, rotation event.
Further, described photo generation unit uses the view data of the current preview area of taking pictures of Camera interface acquisition and is loaded in internal memory becomes Bitmap object; Photo generation unit, according to the size of pinup picture element and position data, uses Canvas.drawbitmap interface by pinup picture element and bitmap object composograph, uses Bitmap.compress interface that view data is saved as jpg formatted file.
Compared with prior art, beneficial effect of the present invention is: the present invention takes pictures preview area, to find a view content for showing camera in real time; Pinup picture mask layer, for loading pinup picture element; Described pinup picture mask layer hides above preview area of taking pictures, and the click of response pinup picture element is selected or editor's event; Photo generation unit, for generating the photo with pinup picture element; When event is taken pictures in triggering, the size of the current pinup picture element of described pinup picture mask layer record and position data, and feed back to photo generation unit; Photo generation unit uses the view data of the current preview area of taking pictures of camera interface acquisition and is loaded in internal memory becomes bitmap object; Photo generation unit, according to the size of pinup picture element and position data, by pinup picture element and bitmap object composograph, and saves as picture format file.The present invention can to take pictures pinup picture by live preview, allows user select pinup picture element and pinup picture region when taking pictures and finding a view, and live preview pinup picture effect, generate the photo with pinup picture after taking pictures at once.
Accompanying drawing explanation
Fig. 1 is the module diagram of the camera system of real-time loading pinup picture element of the present invention.
Embodiment
Describe the present invention in detail below in conjunction with accompanying drawing and specific implementation method, be used for explaining the present invention in exemplary embodiment and description of the present invention, but not as a limitation of the invention.
Embodiment one
As shown in Figure 1, a kind of camera system of real-time loading pinup picture element, described system comprises:
Taking pictures preview area, to find a view content for showing camera in real time;
Pinup picture mask layer, for loading pinup picture element;
Described pinup picture mask layer hides above preview area of taking pictures, and the click of response pinup picture element is selected or editor's event;
Photo generation unit, for generating the photo with pinup picture element;
When event is taken pictures in triggering, the size of the current pinup picture element of described pinup picture mask layer record and position data, and feed back to photo generation unit;
Photo generation unit uses the view data of the current preview area of taking pictures of camera interface acquisition and is loaded in internal memory becomes bitmap object;
Photo generation unit, according to the size of pinup picture element and position data, by pinup picture element and bitmap object composograph, and saves as picture format file.
The present invention can to take pictures pinup picture by live preview, allows user select pinup picture element and pinup picture region when taking pictures and finding a view, and live preview pinup picture effect, generate the photo with pinup picture after taking pictures at once.
Embodiment two
Present embodiments provide a kind of camera system of the real-time loading pinup picture element based on Android system, described system comprises:
Taking pictures preview area, to find a view content for showing camera in real time;
Pinup picture mask layer, for loading pinup picture element, described pinup picture element is png picture format;
Described pinup picture mask layer is ImageView control, and described pinup picture mask layer hides above preview area of taking pictures, and the click of response pinup picture element is selected or editor's event; Described pinup picture mask layer is provided with pinup picture selective listing, and the preset multiple pinup picture element of pinup picture selective listing is selected for user, and described pinup picture selective listing uses ListView control exposure pinup picture element, and responds user and click and select pinup picture elementary event; Editor's event of described pinup picture mask layer response comprises moving event, convergent-divergent event, rotation event;
Photo generation unit, for generating the photo with pinup picture element;
When event is taken pictures in triggering, the size of the current pinup picture element of described pinup picture mask layer record and position data, and feed back to photo generation unit; Photo generation unit uses the view data of the current preview area of taking pictures of Camera interface acquisition and is loaded in internal memory becomes Bitmap object; Photo generation unit, according to the size of pinup picture element and position data, uses Canvas.drawbitmap interface by pinup picture element and bitmap object composograph, uses Bitmap.compress interface that view data is saved as jpg formatted file.
If the function described in the present embodiment using the form of SFU software functional unit realize and as independently production marketing or use time, can be stored in a computing equipment read/write memory medium.Based on such understanding, the part of the part that the embodiment of the present invention contributes to prior art or this technical scheme can embody with the form of software product, this software product is stored in a storage medium, comprising some instructions in order to make a computing equipment (can be personal computer, server, mobile computing device or the network equipment etc.) perform all or part of step of method described in each embodiment of the present invention.And aforesaid storage medium comprises: USB flash disk, portable hard drive, ROM (read-only memory) (ROM, Read-OnlyMemory), random access memory (RAM, RandomAccessMemory), magnetic disc or CD etc. various can be program code stored medium.In this instructions, each embodiment adopts the mode of going forward one by one to describe, and what each embodiment stressed is the difference with other embodiment, between each embodiment same or similar part mutually see.
To the above-mentioned explanation of the disclosed embodiments, professional and technical personnel in the field are realized or uses the present invention.To be apparent for those skilled in the art to the multiple amendment of these embodiments, General Principle as defined herein can without departing from the spirit or scope of the present invention, realize in other embodiments.Therefore, the present invention can not be restricted to these embodiments shown in this article, but will meet the widest scope consistent with principle disclosed herein and features of novelty.