How do I draw a CGImage (30 sq px PNG) upon a host (larger) CGImage <PNG> Image at a specific coordinate?
How do I draw a CGImage (30 sq px PNG) upon a host (larger) CGImage <PNG> Image at a specific coordinate?
- Subject: How do I draw a CGImage (30 sq px PNG) upon a host (larger) CGImage <PNG> Image at a specific coordinate?
- From: "Frederick C. Lee" <email@hidden>
- Date: Fri, 26 Jun 2009 12:25:20 -0700
Environment: iPhone OS 3.0
Greetings:
I would like to place one or more reference icons (png) upon a
host image (png) {Like a street map with legends, landmarks, etc.}.
I'm working with Quartz so I'm using pre-loaded CGImages via
UIImage.CGImage, for both the map/layout and the icons.
I want to incorporate these icons into the same layer as the host map,
so they can scale in unison as essentially one (1) image.
I'm plan to use no scaling (1x scale) at map creation (Or can I work
with a different scale?)
The CGImage destination coordinates would be pre-determined via a
graphics program like GraphicConverter or Photoshop.
So I'm thinking of using CGCongtextDrawLayerInRect().
Questions:
1) Should destination context be the host-image context vs
UIGraphicsGetCurrentContext() ?
If so, how do you get a drawing context from a PNG image?
2) Should the destination CGRect should be the (x,y) locale of the
host image (PNG)?
3) Should I make the source PNG image (the ref icon) a CGLayer object?
4) Can I work with a different scale (say, 4x) to more-accurately
place the icons upon the host?
Regards,
Ric.
Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden