• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How do I draw a CGImage (30 sq px PNG) upon a host (larger) CGImage <PNG> Image at a specific coordinate?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How do I draw a CGImage (30 sq px PNG) upon a host (larger) CGImage <PNG> Image at a specific coordinate?
      • From: Scott Thompson <email@hidden>
  • Prev by Date: Re: GC pros and cons
  • Next by Date: Re: Substituting characters in a UITextField
  • Previous by thread: Re: Unexpected NSWorkspaceDidMountNotification
  • Next by thread: Re: How do I draw a CGImage (30 sq px PNG) upon a host (larger) CGImage <PNG> Image at a specific coordinate?
  • Index(es):
    • Date
    • Thread