English 中文(简体)
利用Quartz2D 几个图像阿雷拉问题?
原标题:Drawing with Quartz2D several Images Array problem?

我正试图用一个简单的绘画来学习。 至今:

CGContextRef context = UIGraphicsGetCurrentContext();


CGContextSetLineWidth(context, 2.0);

CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB();

CGFloat components[] = {0.0, 0.0, 0.0, 1.0};

CGColorRef color = CGColorCreate(colorspace, components);

CGContextSetStrokeColorWithColor(context, color);

CGPoint firstPoint = [[self.array objectAtIndex: 0] CGPointValue];

CGContextMoveToPoint(context, firstPoint.x, firstPoint.y);

for (int i = 0; i < [self.array count]; i++) {
  CGPoint nextPoint = [[self.array objectAtIndex:i] CGPointValue];
   CGContextAddLineToPoint(context, nextPoint.x, nextPoint.y);
}

CGContextStrokePath(context);
CGColorSpaceRelease(colorspace);
CGColorRelease(color);
}

至今为止,它一直在绘制你在阿雷拉的坐标线上的线索。 如果你在另一点停止接触和接触,就把你前面的道路连接起来。 我实际上不想。 因此,我想在触角结束之后再建立一个新的阵列。 我完全错了,或者做事的正确方向? 有时,我没有方案逻辑,但我仍在学习!

提前感谢!

问题回答

如果你想收集你从阵列中提取物品的插手,而且你也希望能够单独提取曲线,那么你应在每条<条码>上建立一个新的阵列。 你们也可以这样做,这并不大不相同。 如果你真的需要把触线坐标储存在一个阵列中,我确信这取决于你的总体功能。





相关问题
How to change out-of-focus text selection color in Xcode?

Okay, I ll bite. I ve got really pleasant code/window colors set up in Xcode. Ordinarily, my selection color is very visible. When I am doing a project search and iterating through the results, ...

Iphone NSTimer Issue

Hi I am new to objective c. I am trying to make an app for iphone. I have a button on my view, and the click on which the function playSound is called. This is working properly. It does plays the ...

Include a .txt file in a .h in C++?

I have a number of places where I need to re-use some template code. Many classes need these items In a .h could I do something like: #include <xxx.txt> and place all of this code in the ....

Iterating over string/strlen with umlauted characters

This is a follow-up to my previous question . I succeeded in implementing the algorithm for checking umlauted characters. The next problem comes from iterating over all characters in a string. I do ...

Xcode open two editor windows with same file

Is it possible to open the same file in two separate windows in Xcode. I can open a file in one window and the same file in the main Xcode editor window, but I wanted two separate fulltime editor ...

Forcing code signing refresh in Xcode

In our environment, we share resources across multiple projects and platforms. When building for iPhone, only a subset of those resources are needed. Since that subset is still considerable, we have ...

热门标签