There are three main methods: Core animation, core graphic, and OpenGL ES.
Ease of operation: Ca> CG> OpenGL
Performance and functionality: OpenGL> CG> Ca
1. Core Animation
Non-entertainment software uses animations, which is easy to operate.
2. Quartz 2D drawing
Is a 2D drawing engine.
(1) The
the graphics are redrawn each time the control is displayed. Obviously this performance is very bad, sometimes need to draw pictures in memory, so that can be exported to the phone local, can also be uploaded on the network. Unlike
drawing directly on UIView, when drawing in memory, developers need to prepare their own drawing environment, and Quartz
Custom view is written in the. m file#import "KKView.h"@interfaceKkview ()/** The Y value of the picture*/@property (nonatomic, assign) cgfloat imgy;@end@implementationKkview- (void) awakefromnib{ //Create Cadisplaylink, default 60 times per secondCadisplaylink *display = [Cadisplaylink displaylinkwithtarget:self selector: @selector (updataimage)]; //adding Cadisplaylink to the message loop[Display Addtorunloop:[nsrunloop mainrunloop] formode:nsdefaultrunloopmode]; }- (void) updataimage{/
For example, to draw a rect, the general method is
Vertexbuffer-> lock ();
Fillrectvertex ();
Vertexbuffer-> unlock ();
Settexture ();
Drawprimitive ();
The validity rate of drawing multiple 2D elements is very low. The reason is that lock/unlock is called multiple times.
Improvement Method:
2d element Rendering
Use a unified memory buffer and Command record.
following code allows the viewport and window to maintain the same aspect ratio to prevent distortion 2 int side = qmin (width (), height ()); 3 int x = (width ()-side/2); 4 int y = (height ()-side/2); 5 Painter.setviewport (x,y,side,side);Transformations of four common coordinate systems:
Pan Qtransform Translate (qreal dx, qreal dy)
Rotary Qtransform Rotate (qreal angle, qt::axis Axis = Qt::zaxis)
Scaling Qtransform scale (qreal SX, Qreal Sy)
Twisted Qtransform Shear
Standard Model embryo 2D drawing software this program is used in graphic
Mingli standardsThe model embryo is 2D, and the operation environment is AutoCAD2000 ~ In version 2007, the command name should be mlts. This program depends on
Mingli Model Accuracy: QB/ml010 2006/11.
Tool usage instructions
1. Open AutoCAD and run the mlts command to display the followi
WPF learning 05: 2D drawing controls Deformation Using Transform, wpftransform
In WPF learning 04: 2D drawing using Shape to draw basic graphics, we learned how to draw basic graphics.
This time, we further study how to deform the image.Example
A triangle formed by Transform:
C # code:
for (int i = 0; i
Shape Introd
WPF learning 05: 2D drawing Transform, wpf052dtransform
In the previous article about WPF learning 04: Drawing 2D shapes, we can draw basic images.
When it comes to graphic application programming, it is not enough to draw only basic graphics. We can use the Transform class provided by WPF to perform deformation operat
C#WPF How do I draw geometry? How to draw a coordinate system?This is inseparable from the path (System.Windows.Shapes) and StreamGeometry (System.Windows.Media) classes.I. Building a WPF ProjectSecond, add codeCode in MainWindow.xamlCode in MainWindow.xaml.csUsing system;using system.collections.generic;using system.linq;using system.text;using System.Threading.Tasks; Using system.windows;using system.windows.controls;using system.windows.data;using system.windows.documents;using System.windows
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.