植物僵尸打不开了,failed to load monoimage:properties/partner_logo

植物大战僵尸为什么不能玩啊?_百度知道
植物大战僵尸为什么不能玩啊?
请问要怎么解决在之前的电脑上可以打开;partner_logo:failed to load image:properties&#92,但是还个电脑之后单击打开之后有这样的提示
那就要求该游戏的路径都为英文路径,建议可以在除C盘之外的一个盘中创建一个英文字母作为名字的文件夹,就是要放在英文名字的文件夹里你安装的应该是英文版的植物大战僵尸吧,然后把游戏放进去
其他类似问题
为您推荐:
植物大战僵尸的相关知识
其他5条回答
把你的路径改成全英文的
英文版的,文件夹的名字不要换成中文的
你安装的应该是英文版的植物大战僵尸吧,那就要求该游戏的路径都为英文路径,就是要放在英文名字的文件夹里,建议可以在D\E\F盘中创建一个英文字母作为名字的文件夹,然后把游戏放进去,应该就可以运行了
你安装的应该是英文版的植物大战僵尸吧,那就要求该游戏的路径都为英文路径,就是要放在英文名字的文件夹里,建议可以在除C盘之外的一个盘中创建一个英文字母作为名字的文件夹,然后把游戏放进去,应该就可以运行知道了吗
植物大战僵尸需要路径是全英文的,你改成全英文试试
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁Getimagesize():failed To Open Stream:
Am geeting warnig with getimagesize() function. I will explain my
query by first giving my code.
$src = $_GET['src'];
$imageInfo = getimagesize($src);
echo $imageInfo[0].& &.$imageInfo[1];
It's working perfectly as i want when, the image is in the absolute
path. For example i am running this file under the /dev folder in root
directory. In dev i have one more folder called images which contain
some jpeg and gif files. Also one more folder called imgs in the root.
For easy understanding i picturized my directory stucture here.
----- images
This contains jpeg and gif files
----- images
--- This also contains jpeg and gif files
----- imagesize.php
--- this is the file contains our
if i run this file by giving
/dev/image...rc=images/1.jpg
It outputs the correct width and height of the image, but for this
/dev/image...c=/images/1.jpg
/dev/image...../images/1.jpg
It wont result any thing, however it thows warning message like this
Warning: getimagesize(/images/1.jpg) [function.getimagesize]: failed to
open stream: No such file or directory in
/home/htdocs/dev/imagesize.php on line 4.
So, this is not working for relative paths.
I have tried it in the different server which is also have same
directory structure. In that it's working for both absolute and
relative paths.
Similar Messages:
ADVERTISEMENT
Ever since we had our php.ini file hardended, we're received the following error when we try the getimagesize() command:Warning: getimagesize(Array) [function.getimagesize]: failed to open stream:
I receive the warning when run the script from localhost (WAMP):Warning: getimagesize(*image url*) [function.getimagesize]: failed to open stream: A system call that should never fail has failed. Where is the problem?
i have a worning massege only on localhost...&Warning: getimagesize(images/cat/) [function.getimagesize]: failed to open stream: No such file or directory in
C:xampphtdocsgiftslibrariesleftmenu.php on line 104&while($cat=mysql_fetch_object($cats)){$maincatname = str_replace(&&&,&--&,$cat-&name);$image=$cat-& $catid=$cat-&categoryID;$image_upload_path = &images/cat/&;$url = $image_upload_path.$cat-&
[Code]....
I want to create File that have Full permission dynamically, that means every
change for ID of session create new file .Unfortunately I faced some problem .Warning: fopen(test.txt) [function.fopen]: failed to open stream: Permission denied in /home/teamroom/public_html/1/3.php on line 2Warning: fwrite(): supplied argument is not a valid stream resource in /home/teamroom/public_html/1/3.php on line 3Warning: fclose(): supplied argument is not a valid stream resource in /home/teamroom/public_html/1/3.php on line 4[Code...]
This problem seems to have been discussed in the past everywhere on google and here, but I have yet to find a solution.A very simple fopen gives me a [URL]The URL I am fetching have no importance because even when I fetcht doesnt work. The exact same script works on different server. The one failing is Ubuntu 10.04 and PHP 5.3.2. This is not a problem in my script, it's something different in my server or it might be a bug in PHP.I have tried using a user_agent in php.ini but no success. My allow_url_fopen is set to On.
I am getting this message when I try to get an include file remotely..Warning: main(URL): failed to open stream: HTTP request failed! HTTP/1.1 200 OK  in ... on line 25Warning: main(): Failed opening '...' for inclusion (include_path='') in ... on line 25It works some time's and not other times. I believe it is because the php file on the remote server is taking to long to process. Is there a way around this.... ie another way to process an include remotely and then have the results included in your program...?
I am stumped. The code is exactly the same and they are both hosted by the same rackspace . . . yet one works fine and the other generates an error:[domdocument.load]: failed to open stream: HTTP request failed! The code is fairly simple:$doc = new DOMDocument();$page_url = **valid XML feed**$doc-&load($page_url);So I do not understand what is causing the error . Also: everything was working fine until yesterday - so it must have been something in one of the (unfortunately very numerous) patches implemented yesterday. Just need an Idea of where to start looking Some investigating reveals it is the feed's problem - (Indeed's job API) - switched to a different job feed provider & everything is working.
Using this code with simplehtmldom script [URL]: I got some error with it: failed to open stream: HTTP request failed! I think should be use curl instead
of file_get_contents in this script.how to inset curl in this script?
for your information i create the simple database in meta_tags.txt Error message: Warning: fopen() [function.fopen]: Couldn't resolve host name in /home/myweddin/public_html/allan/header.php on line 3Warning: fopen[URL] [function.fopen]: failed to open stream: operation failed in /home/myweddin/public_html/allan/header.php on line 3Warning: fgetcsv() expects parameter 1 to be resource, boolean given in /home/myweddin/public_html/allan/header.php on line 7header.php:&?php$database = '[URL]...;$meta_db = fopen($database, 'r');$page = $_SERVER['SCRIPT_NAME'];$page = substr($page, 1);while($data = fgetcsv($meta_db, 9000, '|'))[Code].....
I am requesting a webservice to pull lat/lng coordinates by using country names from a php file using this code:$defaultcountry = $_REQUEST['country'];$daurl = &http://ws.geonames.org/search?q=&.$defaultcountry.'&rows=5';$contents = file_get_contents($daurl);[code]...
php Warning: file(/product/5053975)[function.file]: failed to open stream: HTTP request failed! HTTP/1.1404 Not FoundinI am just trying to put some code around this to trap it.
if php coding can trigger the following message? (memberVO.php is an include file which contains some db classes and db connection info). I've been changing the files in this directory quite a bit, but the warning seems to be random. As per advice on a google search, changed the chmod to 777 for this directory.Warning: main(membersVO.php): failed to open stream: Permission denied in /home/www/www.sars.no/htdocs/database/membersList.php on line 10Warning: main(): Failed opening 'membersVO.php' for inclusion (include_path='.:/usr/share/pear') in /home/www/www.sars.no/htdocs/database/membersList.php on line 10Any ideas?
[function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 401 UnauthorizedI am periodically getting this error, i.e it is only happening at random times, any ideas what would cause this, i have checked my php.ini and allow_url_fopen is set to true.
Trying to upload a file using win xp/iis/php.I've given full access to all accounts trying to get this to work? YetI'm still
getting read errors. Simplified the script below to thebare minimum.simpleupload.php&form enctype=&multipart/form-data& action=&upload.php& method=&post&&&INPUT TYPE=&hidden& name=&MAX_FILE_SIZE& value=&200000&/&&input type=&file& name=&file1&/&&input type=&submit& value=&UploadFile&/&&/form&upload.php&?phpmove_uploaded_file($_FILES['file1']['tmp_name'],'c:phpuploadperm');?&ErrorWarning: move_uploaded_file(c:phpuploadperm): failed to open stream:Permission denied in C:Inetpubwwwrootphpupload.php on line 2Warning: move_uploaded_file(): Unable to move'C:PHPuploadtempphp35.tmp' to 'c:phpuploadperm' inC:Inetpubwwwrootphpupload.php on line 2
I have a script which creates a directory according to username, it was working fine but for some reason gave up on me. The directory isn't being created and that's why i'm
getting this error (I think): Warning: fopen(testuser/index.html) [function.fopen]: failed to open stream: No such file or directory in /home/blabla/public_html/makepage.php on line 9can't open filePHP Code: ....
Warning: file_get_contents('/the_gear/view_product.asp?product_id=1538&product_hierarchy_id=1' ) [function.file-get-contents.php]: failed to open stream: Invalid argument in D:orthernwhippet.co.ukwwwrooterggetcontent2.php on line 3.PHP Code:$var = file_get_contents('Product77.txt');$urlinfo = file_get_contents($var);echo $ data in
Product77.txt.
I'm trying to use file_get_contents but it tells me failed to open stream. My code:[Code].....This is what I get when I try to run it: Warning: file_get_contents(http://...@172.16.214.133/@api/deki/users/=$user_id/properties): failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server ErrorHowever, if I manually type in the $user_id [URL] then it works! What am I doing wrong? Shouldn't I be able to just use the variable name? Remaining code:[Code]....
I'm trying to use file_get_contents() to grab a twitter feed, however I'm getting the following warning: failed to open stream: HTTP request failed! HTTP/1.1 400 Bad RequestMy code:$feed = '/statuses/user_timeline.rss?screen_name=google&count=6';$tweets = file_get_contents($feed);I'm using google just for the sake of testing.
allow_url_fopen is enabled in my php.ini file.
Can anyone helpme out please?. when i try to upload file through browser on my domain i get the following error.
Warning: copy(/uploadedimages/744069.gif): failed to open stream: No such file or directory in httpdocsupload_image.php on line 53 Warning: Cannot modify header information - headers already sent by (output started at httpdocsupload_image.php:53) in httpdocsupload_image.php on line 91 and also this error on the other page. logo.gif, size: 4819 [ Ok ]
Warning: copy(/uploadedimages/825810.gif): failed to open stream: No such file or directory in httpdocsdoupload.php on line 55
I recently had to restart my apache server and ever since then, no scripts that create or upload files to the server are working. I keep getting failed to open stream: Permission denied when trying to create a file or failed to open stream: No such file or directory when trying to upload files when running the scripts. Yes I have checked the most obvious, the folder permissions and they are set to 777 and the owner and group is also correct.
I am wondering if there are any settings in my php.ini that may be causing my scripts to fail?
Or an apache setting that may have gotten reset?
I am going to be converting my website over the next year to be a Php site. Hopefully this is going to coincide with myself learning the basics of Php. I intend to get hold of a copy of Dreamweaver soon, and also get a book on it as well. Anyway, my first attempt at Php has given me an error. What I am trying to do is to put all the header info for my webpages into an include file, so I can just bring the same include file up for the same header info for each page. My first page starts:&?phpinclude (&/header.inc&);?&When viewing the page though I get the following error:Warning: main(.inc): failed to open stream: No such file or directoryin /home/public_html/index.php on line 3Warning: main(): Failed opening '.inc' for inclusion(include_path='.:/usr/lib/php:/usr/local/lib/php') in/home/public_html/index.php on line 3You don't have any idea what this error is do you?
I have a client which is seeing the following error from this code in WordPress: Code:
I've got a problem with requiring some files, PHP is telling me these files do not exist, but when I scan the directory it tells me it does exist.I've simplified the files to the require functionality, and it's still not working.Here is my setup:root/test.phptest/[code]...
Am trying to upload an image from my local machine (PC) to the FTP server. In return, received the following error:Warning: ftp_put(c:/dhimage/DSC_0067.JPG) [function.ftp-put]: failed to open stream: No such file or directory in /home/dxxx/public_html/ftp/test.php on line 37Cannot uploadHere's my code:// get FTP access parameters$host = '';$user = 'abcxxx';[code]...
I am running php5 on my mac osx 10.5.
If I write a simple php script:&?phpfile_get_contents('');?&And run it in the command line, I get the following error:&Warning: file_get_contents(): failed to open stream: Host is down&I'm not sure if I'm missing some setting in php.ini or something. I know if I run the same script off of my server, it executes w/o warning.
I've got some functions in my file that require taxonomy.php to execute. I'm attempting to include the file like so...(this is called from functions.php, which is located in p_content/themes/mytheme/include($_SERVER['DOCUMENT_ROOT'] .'/wp-admin/includes/taxonomy.php');However, depending on the particular server setup, its hit or miss (mostly hit) whether the include will be found. In the case its not found, I get this error...Warning: include(/home//wp-admin/includes/taxonomy.php) [function.include]: failed to open stream: No such file or directory in /home//testing123/wp-content/themes/mytheme/functions.php on line 10
In this code :$path = &C:NucServwwwvvstaticarraysews.php&;$fp = fopen($path, &w&);if(fwrite($fp=fopen($path,&w&),$text)){echo &ok&;}fclose($fp);I have this error message: failed to open stream: Invalid argument
I'm writing a PHP application and in my code i want to create create and return images to the browser. However, sometimes i'm getting some weird results where the image cannot be created since the file does not seem to exist. Here is a sample error message I get and the code in a nutshell. I do know that the image exists, but still the method sometimes fails, and sometimes it succeeds, even for the same file.The error:
Warning: imagecreatefrompng(path/to/image.png) [function.imagecreatefrompng]: failed to open stream: No such file or directory in file test.php on line 301The code:if (file_exists($filename)) {$image = imagecreatefrompng($filename);}
I want use simple_html_dom.php to get some work.$html = file_get_html('http:url');foreach($html-&find('p') as $element) {echo $[URL]... 1.How to add a judge if failed to open stream:then echo 'this is not a valid url';?2.How to make a judge if there is no p tag in foreach, then echo 'Can not find p tag';?
I have just uploaded my website to my ftp server but I'am getting this error when I try to view a php page, i get that it's to do with my directory but I'am confused to how to set it up because all the files are uploaded.
Copyrights 2005-15 , All rights reservedAdobe Flex 4.6 * Image control
Image control
Flex supports several image formats, including GIF, JPEG, and PNG.
You can import these images into your applications by using the
control or .
To load SWF files, you use the
The Image control is part of both MX and Spark component sets.
While you can use the MX Image control in your application, Adobe
recommends that you use the Spark Image control instead.
Flex provides the following image controls:
Image control
BimapImage
a light-weight image control that can load both local and remote
assets. You typically use the BitmapImage when you don’t require
a broken image icon or a preloader.
The BitmapImage also supports
runtime loading of images. However, when you load images at runtime, you
should be aware of the security restrictions of Flash Player or
AIR. For more information, see .
Spark Image
The Spark Image is a skinnable component
that leverages a
as its main skin part.
The Spark Image control provides a
preloader as well as a broken image icon to indicate an invalid
image state. The image loader and the broken-image icon are both
customizable. For example, you can provide a broken image icon representing
an invalid URL, or provide a progress bar as the image loads. The
Spark Image control also provides customizable skinning for borders,
frames, and loading states. For more information, see .
The Spark Image control lets
you load local and trusted assets, as well as remote and untrusted
assets. Security restrictions are applicable in case of untrusted
assets. For more information, see .
Flex also includes the
for loading applications built in Flex. You typically use the Image control
for loading static graphic files, and use the SWFLoader control
for loading SWF files and applications built in Flex. The Image
control is also designed for use in custom item renderers and item
For more information on the SWFLoader control, see .
The following example shows a BitmapImage embedded at compile
time and a BitmapImage loaded at runtime:
&?xml version="1.0"?&
&!-- controls\image\ImageBitmapImageExample.mxml --&
&s:Application xmlns:fx="/mxml/2009"
xmlns:s="library:///flex/spark"
xmlns:mx="library:///flex/mx"
width="700"&
&s:Panel title="BitmapImage Examples" width="600"&
&s:layout&
&s:HorizontalLayout horizontalAlign="center"/&
&/s:layout&
&s:BorderContainer width="50%" height="100%"&
&s:layout&
&s:VerticalLayout
verticalAlign="middle"
horizontalAlign="center"/&
&/s:layout&
&s:Label text="BitmapImage embedded at compile time"/&
&s:BitmapImage id="embimg" source="@Embed(source='fblogo.jpg')"
height="50" width="50"/&
&/s:BorderContainer&
&s:BorderContainer width="50%" height="100%"&
&s:layout&
&s:VerticalLayout
verticalAlign="middle"
horizontalAlign="center"/&
&/s:layout&
&s:Label text="BitmapImage loaded at runtime"/&
&s:BitmapImage id="runtimeimg" source="../assets/flexlogo.jpg"
height="50" width="50"/&
&/s:BorderContainer&
&/s:Panel&
&/s:Application&The executing SWF file for the previous example is shown below:
For a video on using Spark Image and BitmapImage, see
About loading imagesFlex supports loading GIF, JPEG, and PNG files at runtime,
and also embedding GIF, JPEG, and PNG files at compile time. The
method you choose depends on the file types of your images and your
application parameters.
Embedded images load immediately, because they are already part
of the Flex SWF file. However, they add to the size of your application
and slow down the application initialization process. Embedded images
also require you to recompile your applications whenever your image
files change. For an overview of resource embedding, see .
The alternative to embedding a resource is to load the resource
at runtime. You can load a resource from the local file system in
which the SWF file runs. You can also access a remote resource,
typically though an HTTP request over a network. These images are
independent of your application built with Flex, so you can change
them without causing a recompile operation as long as the names
of the modified images remain the same. The referenced images add
no additional overhead to an application’s initial loading time.
However, you can sometimes experience a delay when you use the images
and load them into Adobe Flash Player or AIR.
A SWF file can access one type of external resource only, either
loc it cannot access both types. You determine
the type of access allowed by the SWF file by using the use-network flag
when you compile your application. When use-network flag
is set to false, you can access resources in the
local file system, but not over the network. The default value is true,
which allows you to access resources over the network, but not in
the local file system.
For more information on the use-network flag,
When you load images at runtime, you should be aware of the security
restrictions of Flash Player or AIR. For example, you can reference
an image by using a URL, but the default security settings only
permit applications built in Flex to access resources stored on
the same domain as your application. To access images on other servers,
ensure that the domain that you are loading from uses a crossdomain.xml
For more information on application security, see .
Loading and embedding images with Spark Image and BitmapImage controlsThe
the following actions when you load an image:
Specifying the image pathThe value of
the source property of a
a relative or absolute path, or URL to the imported image file.
If the value is relative, it is relative to the directory that contains
the file that uses the tag.
The source property
has the following forms:
source="@Embed(source='relativeOrAbsolutePath')"
referenced image is packaged within the generated SWF file at compile time
when Flex creates the SWF file for your application. You can embed
GIF, JPEG, and PNG files. When embedding an image, the value of
the source property must be a relative or absolute
path to a file on the Flex developer’ it cannot
The following example embeds a JPEG image into
an application that is built in Flex:
&?xml version="1.0"?&
&!-- controls\image\ImageSimpleEmbed.mxml --&
&s:Application xmlns:fx="/mxml/2009"
xmlns:s="library:///flex/spark"
xmlns:mx="library:///flex/mx"&
&s:Image id="loader1" source="@Embed(source='logo.jpg')"/&
&/s:Application&The executing SWF file for the previous example is shown below:
In this example, the size of
the image is the default size of the image file.
source="relativeOrAbsolutePathOrURL"
loads the referenced image file at runtime, typically from a location
that is depl the image is not packaged as part
of the generated SWF file. You can only reference GIF, JPEG, and
PNG files.
The following example accesses a JPEG image at
&?xml version="1.0"?&
&!-- controls\image\ImageSimple.mxml --&
&s:Application xmlns:fx="/mxml/2009"
xmlns:s="library:///flex/spark"
xmlns:mx="library:///flex/mx"&
&s:Image id="loader1" source="assets/flexlogo.jpg"/&
&/s:Application&The executing SWF file for the previous example is shown below:
Because you did not use @Embed in
the source property, Flex loads the image at runtime.
In this case, the location is the same directory as the page that
embedded the SWF file.
When the use-network flag
is set to false, you can access resources in the local
file system, but not over the network. The default value is true,
which allows you to access resources over the network, but not in
the local file system.
In many applications, you create a directory
to hold your application images. Commonly, that directory is a subdirectory
of your main application directory. The source property
supports relative paths to images, which let you specify the location
of an image file relative to your application directory.
following example stores all images in an assets subdirectory of
the application directory:
&?xml version="1.0"?&
&!-- controls\image\ImageSimpleAssetsDir.mxml --&
&s:Application xmlns:fx="/mxml/2009"
xmlns:s="library:///flex/spark"
xmlns:mx="library:///flex/mx"&
&s:Image id="loader1" source="@Embed(source='assets/logo.jpg')"/&
&/s:Application&The executing SWF file for the previous example is shown below:
The following example uses
a relative path to reference an image in an assets directory at
the same level as the application’s root directory:
&?xml version="1.0"?&
&!-- controls\image\ImageSimpleAssetsDirTop.mxml --&
&s:Application xmlns:fx="/mxml/2009"
xmlns:s="library:///flex/spark"
xmlns:mx="library:///flex/mx"&
&s:Image id="loader1" source="@Embed(source='../assets/logo.jpg')"/&
&/s:Application&The executing SWF file for the previous example is shown below:
You can also reference an image
by using a URL, but the default security settings only permit applications
to access resources stored on the same domain as your application.
To access images on other servers, make sure that the domain that you
are loading the image from uses a crossdomain.xml file that allows
cross-domain access.
Cross-domain image loading is supported
with restrictions. You can load local and trusted assets, as well
as remote and untrusted assets. When you use untrusted assets, security
restrictions are applicable. When a cross-domain image is loaded
from an untrusted source, the security policy does not allow access
to the image content. Then, the trustedSource property
of the BimapImage and Spark Image is set to false,
and the following image properties do not function:
BitmapFillMode.REPEAT
smoothingQuality
Any advanced
operations on the image data, such as, high-quality scaling or tiling,
are not supported.
For more information, see .
following example shows how to reference an image by using a URL:
&?xml version="1.0"?&
&!-- controls\image\ImageSimpleAssetsURL.mxml --&
&s:Application xmlns:fx="/mxml/2009"
xmlns:s="library:///flex/spark"
xmlns:mx="library:///flex/mx"&
&s:Image id="image1"
source="http://localhost:8100/flex/assets/logo.jpg"/&
&/s:Application&
You can use
relative URLs for images hosted on the same web server as the application,
but load these images over the Internet rather than access them
Using an image multiple timesYou can
use the same image multiple times in your application by using the normal
image import syntax each time. Flex only loads the image once, and
then references the loaded image as many times as necessary.
Sizing and scaling an imageYou can size and scale images using both the Spark Image
and BimapImage controls.
Sizing an imageFlex sets the height and width of
an imported image to the height and width settings in the image
file. By default, Flex does not resize the image.
an explicit height or width for an imported image, set its height and width properties
of the image control. Setting the height or width property prevents
the parent from resizing it. The scaleContent property
has a default value of true; therefore, Flex scales
the image as it resizes it to fit the specified height and width.
The aspect ratio is maintained by default for a Spark Image, so the
image may not completely fill the designated space. Set the scaleContent property
to false to disable scaling.
When you resize
a BitmapImage, the aspect ratio is not maintained, by default. To ensure
that you maintain the aspect ratio, change the value of the scaleMode property
from stretch to letterbox or zoom.
For more information about image aspect ratios, see below.
common use for resizing an image is to create image thumbnails.
In the following example, the image has an original height and width
of 100 by 100 pixels. By specifying a height and width of 20 by
20 pixels, you create a thumbnail of the image.
&?xml version="1.0"?&
&!-- controls\image\ImageSimpleThumbnail.mxml --&
&s:Application xmlns:fx="/mxml/2009"
xmlns:s="library:///flex/spark"
xmlns:mx="library:///flex/mx"&
&s:BitmapImage id="image1"
source="@Embed(source='logo.jpg')"
width="20" height="20"
smooth="true" smoothingQuality="high"/&
&s:BitmapImage id="image2"
source="@Embed(source='logo.jpg')"/&
&/s:Application&The executing SWF file for the previous example is shown below:
When you downscale a BimapImage,
the default quality for scaled bitmaps, BitmapSmoothingQuality.DEFAULT,
If you want to preserve the aspect ratio when creating
image thumbnails, and achieve the best quality result when downscaling
a BitmapImage, set the smoothingQuality property
to BitmapSmoothingQuality.HIGH. The smoothingQuality property
is applicable only when you set the smooth property
of the BitmaImage to true. When you do so, a multi-bit-rate
step algorithm is applied to the image, resulting in a much higher
quality downscale than the default. This option is useful in creating
high-quality image thumbnails.
To let Flex resize the image
as part of laying out your application, set the height and width properties
to a percentage value. Flex attempts to resize components with percentage
values for these properties to the specified percentage of their
parent container. You can also use the maxHeight and maxWidth and minHeight and minWidth properties
to limit resizing. For more information on resizing, see .
Maintaining aspect ratio when sizingThe aspect ratio of an
image is the ratio of its width to its height. For example, a standard
NTSC television set uses an aspect ratio of 4:3, and an HDTV set
uses an aspect ratio of 16:9. A computer monitor with a resolution
of 640 by 480 pixels also has an aspect ratio of 4:3. A square has
an aspect ratio of 1:1.
All images have an inherent aspect
ratio. When you use the height and width properties
to resize an image, Flex preserves the aspect ratio of the image,
by default, so that it does not appear distorted.
By preserving
the aspect ratio of the image, Flex might not draw the image to
fill the entire height and width specified for the &s:Image& tag.
For example, if your original image is a square 100 by 100 pixels,
which means it has an aspect ratio of 1:1, and you use the following
statement to load the image:
&s:Image source="myImage.jpg" height="200" width="200"/&
image increases to four times its original size and fills the entire
200 x 200 pixel area.
The following example sets the height
and width of the same image to 150 by 200 pixels, an aspect ratio
&s:Image source="myImage.jpg" height="150" width="200"/&
this example, you do not specify a square area for the resized image.
Flex maintains the aspect ratio of a Spark Image by default because
the scaleMode property is set to letterbox.
Therefore, Flex sizes the image to 150 by 150 pixels, the largest
possible image that maintains the aspect ratio and conforms to the
size constraints. The other 50 by 150 pixels remain empty. However,
the &s:Image& tag reserves the empty pixels
and makes them unavailable to other controls and layout elements.
ensure that you maintain the aspect ratio when you resize a BitmapImage, change
the value of the scaleMode property from stretch to letterbox or zoom.
you resize an image, you can apply the required alignment properties.
The Spark Image and BitmapImage both have horizontalAlign and verticalAlign properties
that you can specify, as required.
By default, the horizontalAlign and verticalAlign properties
are set to center. For example, when you resize
an image that has an original height and width of 1024 by 768 to
a height and width of 100 by 100, there is extra space at the top
and bottom of the image. You can set the the horizontalAlign and verticalAlign properties
as required to overcome the extra space.
can also use a Resize effect to change the width and height of an
image in response to a trigger. As part of configuring the Resize
effect, you specify a new height and width for the image. Flex maintains
the aspect ratio of the image by default, so it resizes the image
as much as possible to conform to the new size, while maintaining
the aspect ratio. For example, place your pointer over the image
in this example to enlarge it, and then move the mouse off the image
to shrink it to its original size:
&?xml version="1.0"?&
&!-- controls\image\ImageResize.mxml --&
&s:Application xmlns:fx="/mxml/2009"
xmlns:s="library:///flex/spark"
xmlns:mx="library:///flex/mx"&
&fx:Script&
import mx.effects.R
&/fx:Script&
&fx:Declarations&
&s:Resize id="resizeBig"
widthFrom="22" widthTo="44"
heightFrom="27" heightTo="54"/&
&s:Resize id="resizeSmall"
widthFrom="44" widthTo="22"
heightFrom="54" heightTo="27"/&
&/fx:Declarations&
&s:Image width="22" height="27"
source="@Embed('logo.jpg')"
rollOverEffect="{resizeBig}"
rollOutEffect="{resizeSmall}"/&
&/s:Application&
The executing SWF file for the previous example is shown below:
For more information on the
Resize effect, see .
Scaling images using fillMode and scaleMode propertiesYou
use the fillMode image property to determine how
an image fills into a region.
You can use the fillMode property
in a tag or in ActionScript, and set one of the following values:
scale: scales the image to fill the bounding
clip: displays the image in its original
size. If the image is larger than the bounding region, the image
is clipped to the size of the bounding region. If the image is smaller
than the bounding region, an empty space is left.
repeat: repeats or tiles the image and fills
into the dimensions of the bounding region.
you set the fillMode property to scale ,
you can set the scaleMode property to stretch, letterbox,
When you use the fillMode property
in ActionScript, you use BitmapFillMode.CLIP, BitmapFillMode.REPEAT,
or BitmapFillMode.SCALE.
To stretch the
image content to fit the bounding region, set the attribute value
to BitmapScaleMode.STRETCH. If you set the value
to BitmapScaleMode.LETTERBOX, the image content
is sized to fit the region boundaries while maintaining the same
aspect ratio as the original unscaled image. For BitmapScaleMode.ZOOM,
the image content is scaled to fit with respect to the original
unscaled image's aspect ratio. This results in cropping along one
The following example shows the Flex logo scaled in
the letterbox-mode and stretch-mode using the fillMode and scaleMode properties:
&?xml version="1.0"?&
&!-- controls\image\ImageScaling.mxml --&
&s:Application xmlns:fx="/mxml/2009"
xmlns:s="library:///flex/spark"
xmlns:mx="library:///flex/mx"&
&s:controlBarContent&
&s:FormItem label="scaleMode:"&
&s:DropDownList id="ddl" selectedItem="letterbox"&
&s:dataProvider&
&s:ArrayList source="[letterbox,scale]" /&
&/s:dataProvider&
&/s:DropDownList&
&/s:FormItem&
&/s:controlBarContent&
&s:Image id="image"
source="assets/flexlogo.jpg"
height="20" width="20"
fillMode="scale"
scaleMode="{ddl.selectedItem}"
left="20" right="20" top="20" bottom="20" /&
&/s:Application&
The executing SWF file for the previous example is shown below:
For more code examples,
Skinning the Spark Image controlThe Spark Image control lets you customize the appearance
of you image through skinning.
When you use the &s:Image& tag to import
an image, a default skin class, ,
is created. The default skin provides a simple image skin that has
a content loader with a generic progress bar and a broken image
icon to reflect invalid content.
The ImageSkin class provides Spark and wireframe-themed skins
that let you customize the content loader and the icon to identify
images that failed to load. You also have customizable skinning
for borders, frames, and loading states.
The ImageSkin class defines the following optional skin parts:
imageDisplay:BitmapImage: Lets you
specify the image to display for invalid content or loading error.
ProgressIndicator:Range: Lets you specify
the range, maximum, and minimum values of the progress bar. Use
the stepSize property to specify the amount by
which the value changes when the changeValueByStep() method
is called.
For information about the different skin states, see the source
code for the
For examples on customizing skins and icons for the Spark Image
control, see Peter deHann’s .
Caching and queuing of imagesThe ContentCache class supports caching and queuing of
remote image assets, and can be associated with the
You set the caching and queuing properties for the image content
loader as follows:
&fx:Declarations&
&s:ContentCache id="imgcache" enableCaching="true" enableQueueing="true"
maxActiveRequests="1" maxCacheEntries="10"/&
&/fx:Declarations&
To have a content loader with only queuing capabilities and no
caching capabilities, set enableCaching to false.
The difference that you notice in image-loading when you use
the caching-queuing mechanism can be significant, especially with
large images. Without caching, large images can take several seconds
to load. For example, you can use caching and queuing to prevent
image-flickering in a scrolling list.
The ContentCache class provides the following methods and properties
to manage caching and queuing:
Caching properties
Property name
Description
maxCacheEntries
Specifies the number of cache entries that
can be stored at a given time. When the cache entries exceed the
specified number, the least recent cache entries are automatically
removed. The default value is 100.
enableQueuing
Enables queuing of images. The default value
enableCaching
Enables caching of images. The default value
maxActiveRequests
Specifies the number of pending load requests
that can be active at a given time when image-queuing is enabled.
The default value is 2.
Caching methods
Method name
Description
Returns the requested image using the ContentRequest instance.
If the image is still loading, ContentRequest returns
a value of false. If the requested image is found
in the cache, ContentRequest returns a value of complete.
removeAllCacheEntries()
removeCacheEntry()
Removes cache entries.
Use removeCacheEntry() to
remove a single cache entry that's no longer needed. Use removeAllCacheEntries() to
remove all the cached content.
getCacheEntry()
Checks for a pre-existing cache entry, and
if found, obtains a reference to the cache entry.
addCacheEntry()
Adds a new cache entry. Use addCacheEntry to
manually add a cache entry.
Queuing methods
Description
prioritize()
Forces all pending requests of the specified
contentLoaderGrouping to be moved to the top of the request list,
when image-queuing is enabled. Any active URL requests at that time
are canceled and requeued if their contentLoaderGrouping does not
match the prioritized content grouping.
removeAllQueueEntries()
Cancels all the queued requests.
Example on caching and queuing imagesThe
following example shows loading of images using the contentLoader. Caching
and queuing are enabled and custom item renderers are used.
&?xml version="1.0"?&
&!-- controls\image\ImageCaching.mxml --&
&s:Application xmlns:fx="/mxml/2009"
xmlns:s="library:///flex/spark"
xmlns:mx="library:///flex/mx"&
&fx:Style&
@namespace s "library:///flex/spark";
@namespace mx "library:///flex/mx";
enableLoadingState:
&/fx:Style&
&fx:Script&
import mx.collections.ArrayL
protected var arrList:ArrayList = new ArrayList();
protected function init():void {
var rand:String = new Date().time.toString()
var arr:Array = [];
arr.push({src:"http://localhost:8100/flex/assets/fblogo.jpg?" + rand, cache:ldr});
arr.push({src:"http://localhost:8100/flex/assets/flexlogo.jpg?" + rand, cache:ldr});
arrList = new ArrayList(arr);
dataGrp.dataProvider = arrL
&/fx:Script&
&fx:Declarations&
&s:ContentCache id="ldr" enableQueueing="true"
maxActiveRequests="1" maxCacheEntries="10"/&
&/fx:Declarations&
&s:Panel title="Loading images using the caching-queuing mechanism" x="20" y="20"&
&s:controlBarContent&
&s:Button label="Load Images" click="init();"/&
&/s:controlBarContent&
&s:DataGroup id="dataGrp"&
&s:layout&
&s:TileLayout /&
&/s:layout&
&s:itemRenderer&
&fx:Component&
&s:ItemRenderer dataChange="imageDisplay.source = data."&
&s:Image id="imageDisplay" contentLoaderGrouping="gr1"
contentLoader="{data.cache}" width="200" height="200" /&
&/s:ItemRenderer&
&/fx:Component&
&/s:itemRenderer&
&/s:DataGroup&
&/s:Panel&
&/s:Application&
You can replace
the URLs in the example to access images over the Internet rather
than access them locally.
Loading images using a customizable load interfaceFlex provides a customizable content loader, ,
to load images. The IContentLoader has a simple interface that contains
a load method to manage the load requests. For
a given source, which is usually a URL, the load method returns
the requested resources using the ContentRequestinstance.
The ContentRequest instance provides the load progress
information and also notifies any content validation errors.
The load method also provides a contentLoaderGrouping instance
to manage multiple load requests as a group. For example, the ContentCache's queuing
methods allows requests to be prioritized by contentLoaderGrouping.
&Twitter(TM) and Facebook posts are not covered under the terms of Creative Commons.}

我要回帖

更多关于 failed previousload 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信