objective c - Need help to make own coordinate system (classic, center of UIView is 0,0) -


i need create own coordinate system in uiview, 0,0 center of uiview. don't know ho this. please help.

uiview *view = /*...*/; cgcontextref ctx = /*...*/;  /* shift center ul corner mid-x, mid-y. */ cgrect bounds = [view bounds]; cgfloat hx = bounds.size.width / 2.0; cgfloat hy = bounds.size.height / 2.0; cgcontexttranslatectm(ctx, hx, hy);  /* y still increases down, , x right. */ /* if want y increase up, flip y: */ cgcontextscalectm(ctx, 1.0/*sx*/, -1.0/*sy*/); 

Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -