NSImage的坐标系统
来源:互联网 发布:课程可从哪些方面优化 编辑:程序博客网 时间:2024/06/06 03:40
Image Coordinate Systems
Like views, NSImage
objects use their own coordinate system to manage their content, which in this case is the image data itself. This internal coordinate system is independent of any containing views into which the image is drawn. Although you might think understanding this coordinate system is important for drawing images in your views, it actually is not. The purpose of the internal coordinate system is to orient the image data itself. As a result, the only time you should ever need to know about this internal coordinate system is when you create a new image by locking focus on an NSImage
object and drawing into it.
Image objects have two possible orientations: standard and flipped. When you create a new, emptyNSImage
object, you can set the orientation based on how you want to draw the image data. By default, images use the standard Cartesian (unflipped) coordinate system, but you can force them to use a flipped coordinate system by calling thesetFlipped:
method of NSImage
prior to drawing. You must always set the image orientation before you lock focus on the image and start drawing though. Changing the orientation of the coordinate system after alockFocus
call has no effect. In addition, calling the setFlipped:
method after you unlock focus again may not have the desired results and should be avoided.
When drawing images in your view, you can think of the image as just a rectangle with some data in it. Regardless of the orientation of its internal coordinate system, you always place an image relative to the current view’s coordinate system.Figure 6-1 shows two images drawn in an unflipped view. The code used to draw each image uses the coordinate points shown in the figure, which are in the view’s (unflipped) coordinate system. Because the first image uses a flipped coordinate system internally, however, it draws its content upside down.
Image orientation in an unflipped view- NSImage的坐标系统
- NSImage的作用
- NSImage的缓存
- NSImage
- 对NSImage的一个扩展
- NSimage的size和pixels
- 对NSImage的一个扩展
- 坐标系统的转换
- IOS的坐标系统
- TexturePacker的坐标系统
- QT的坐标系统
- Opengl的坐标系统
- unity3d 的 坐标系统
- 常用的坐标系统
- nsimage 转 png ,jpg的nsdata 类型
- GIS的坐标系统(转载)
- TeeChart的多坐标系统
- vml的中的坐标系统
- CHANGE THE MAC 10.7 LION LOGIN SCREEN BACKGROUND IMAGE?
- 软件工程概述
- [MFC]ADO 数据库编程参考
- NSImage的Drawing方法与Compositing方法的对比
- 在ubuntu 11.10 64位 上安装adobe flash player
- NSImage的坐标系统
- HDU 4034 Graph The 36th ACM/ICPC Asia Regional Chengdu Site —— Online Contest
- 学习Linux/UNIX编程方法的建议
- Object-C学习笔记二-----面向对象编程基础知识
- HDU 4038 Stone The 36th ACM/ICPC Asia Regional Chengdu Site —— Online Contest
- AndEngine Button(2)——点击切换显示图片Button
- NSImage的作用
- 自己山寨的DebugMan论坛
- import/export win7中电源计划