### QPx_NewImporterForURL

QPx_NewImporterForURL(importerRef; imageURL):error
| importerRef | Longint | New graphics importer reference
| imageURL | Text | URL to the image
| error | Longint | Error result

Creates a graphics importer instance for the image stored at the specified URL and returns a reference to this importer instance. This reference is used with all QPix commands in this group to refer to the graphics importer instance and to its associated data. QuickTime 4.0 supports the http://, ftp://, and file:// URL schemes.

The reference to the importer instance is returned in the importerRef parameter. QPix calls QuickTime to identify the image and create an instance of the proper graphics importer. QuickTime iterates over all available importers, checking the importer type and flags, until it finds an importer that can handle the specified graphics file. If the specified file format is not supported by any importer, importerRef is set to 0 and the qpx_paramErr error code is returned.

If imageURL is empty, QPix presents a URL selection dialog where the user can type or paste a URL, or select a recently visited URL from a popup menu. If the user provides a URL, it is returned in imageURL. If the user cancels the dialog, error qpx_userCancelErr is returned.

Possible network-related errors:

qpx_urlDataHHTTPProtocolErr | -2129 | HTTP protocol error
qpx_urlDataHHTTPNoNetDriverErr | -2130 | No network driver for HTTP
qpx_urlDataHHTTPURLErr | -2131 | URL error
qpx_urlDataHHTTPRedirectErr | -2132 | HTTP redirection error
qpx_urlDataHFTPProtocolErr | -2133 | FTP protocol error
qpx_urlDataHFTPShutdownErr | -2134 | The FTP server has closed the connection
qpx_urlDataHFTPBadUserErr | -2135 | User name rejected by FTP server
qpx_urlDataHFTPBadPasswordErr | -2136 | User password rejected by FTP server
qpx_urlDataHFTPServerErr | -2137 | FTP server error
qpx_urlDataHFTPDataConErr | -2138 | FTP data connection error
qpx_urlDataHFTPNoDirectoryErr | -2139 | FTP no directory
qpx_urlDataHFTPQuotaErr | -2140 | FTP quota error
qpx_urlDataHFTPPermissionsErr | -2141 | FTP permissions error
qpx_urlDataHFTPFilenameErr | -2142 | FTP filename error
qpx_urlDataHFTPNoNetDriverErr | -2143 | No network driver for FTP
qpx_urlDataHFTPBadNameListErr | -2144 | Bad name in FTP session
qpx_urlDataHFTPNeedPasswordErr | -2145 | Password error in FTP session
qpx_urlDataHFTPNoPasswordErr | -2146 | Password error in FTP session
qpx_urlDataHFTPServerDisconErr | -2147 | FTP server disconnected
qpx_urlDataHFTPURLErr | -2148 | Bad FTP URL

Note: After you have finished working with an importer instance, you should destroy it by calling QPx_FreeImporter.

Example

``Create an importer for an image referenced by a URL` `` `C_LONGINT($error)` `C_TEXT($imageURL)` `C_LONGINT(gQPixImporter)` `` `$imageURL:="http://www.someplace.com/image.jpg"` `` `$error:=QPx_NewImporterForURL (gQPixImporter;$imageURL)` `` `If ($error=qpx_noErr)` ``Importer created successfully` `End if`

QPix © Escape
Generated by QDoc 2.8 on Wed, Feb 17, 2010 17:44:44