English 中文(简体)
利用实际的餐厅,在外岛展示
原标题:Drawing, using actual pixels, on retina display

What I need to do to draw some shapes on retina display, defining actual screen pixels. I mean that I need that all lines will be 1 pixel width, and no antialiasing. And, if i write the the code:

CGContextMoveToPoint(context,0,0);
CGContextAddLineToPoint(context,0,959);

然后,显示器将从顶端左上层到最左侧最底层的六分之一,包括它。

If I understood well, I need to use CGContextScaleCTM. But there is not always the same regularity in coordinates. Sometimes there is offset on Y-axis, and sometimes no. I have tried to write some macro for converting the coordinates, but have confused at all. I know, that there is logical points and auto positioning stuff. But that is the point that I need to draw all the pixels manually, cause I m developing some util.

最佳回答

相反:

CGContextMoveToPoint(context, 0.5, 0);
CGContextAddLineToPoint(context, 0.5, 959);

<>光> 1 1.0 个Pixel宽线将放在你给它的坐标上。 因此,如果你开始(0,0),其中一半将列入1-1至0栏,一半的线将列入0至1栏。 愤怒坐标使你能够看到像黑板图像这样的东西。

问题回答

暂无回答




相关问题
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 ...

热门标签