Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dialog background image




On Jun 21, 2005, at 9:50 PM, Simon Harms wrote:

Hi guys,

This is probably a very simple question.
I am currently trying to set a jpeg(don't mind using a pdf or other format) as the background image for a dialog
I am writing in carbon and I just cannot work out how to do this
I have looked at the API's and example code but nothing seems to help
I am trying to do this for a splash screen
I want the code to be both backwards and forwards compatible (so no quick draw and no hiview)
which makes things complictated



Any help would be very much appreciated


Hi Simon,

A few tips first:

- you should specify a subject for your message
- since this is a Carbon question, it's more appropriate for the carbon-dev mailing list than for quartz-dev


Your request that the solution use neither Quickdraw nor HIView is very limiting. You almost have to use one or the other; not using either doesn't leave you much room for a solution.

A solution that works on 10.2 and later would be:

- create a compositing window
- embed an HIImageView into the compositing window's content view. Position it at the bottom of the window's view hierarchy.
- load the background image into memory using CGImageCreateWithJPEGDataProvider
- set the HIImageView's image to be the CGImage that you've loaded


It's important to use a compositing window, because in a non- compositing window, the controls in the window will erase their content areas before drawing, and that will leave blocky white splotches on your picture. It's possible to avoid this for some controls by patching out the QD bottlenecks for the port while the control is drawing, but not easy, so we highly recommend compositing mode.

-eric

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartz-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartz-dev/email@hidden

This email sent to email@hidden
References: 
 >(no subject) (From: Simon Harms <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.