How can I store bitmap data in the SharedObject class?
Any ideas?
What I tried to do. First run the "code" then the "Second code '.
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Script> <![CDATA[ import mx.controls.Image; private function init():void { var o:SharedObject = SharedObject.getLocal("t1","/"); //First code o.clear(); var bit:Bitmap= new Bitmap(new BitmapData(100,100,false,0)); o.data.bit=bit; o.flush(); //Second code var bit:Bitmap = o.data.bit; var pic:Image = new Image(); pic.source=bit; Application.application.addChild(pic); } ]]> </mx:Script> </mx:Application>
godilya,
Sorry about that. Since there were a lot of mistakes in your code I just fixed all. But you are right that even after he still not actually saved it to the SO.
I would recommend saving them as a ByteArray, that appears in literature as one of the supported by the SharedObject object classes.
First code
var bitmap: Bitmap = new Bitmap (BitmapData (100,100,false,0xFF0000) new);
var bitmapData:BitmapData = bitmap.bitmapData;
var byteArray:ByteArray = bitmapData.getPixels (bitmapData.rect);
so. Clear();
so.data.byteArray = byteArray;
so. Data.Width = bitmapData.rect.width;
so. Data.Height = bitmapData.rect.height;
so. Flush();
Second code
var byteArray:ByteArray = ByteArray (so.data.byteArray);
var bitmapData:BitmapData = new BitmapData (so.data.width, so.data.height);
bitmapData.setPixels (bitmapData.rect, byteArray);
var bitmap: Bitmap = new Bitmap (bitmapData);
Photo: Image of var = new Image();
PIC.source = bitmap;
Application.application.addChild (pic);
Thank you
Philippe
Post edited by: Philip Keiter
Tags: Flex
Similar Questions
-
How can I insert a date on the signature line?
How can I insert a date automatically on the signature line?
Digital signature fields display the date and time when they were signed by default.
-
How can I recover my data from the address book?
I have an old Palm V. My hotsync cable is bad, it synchronizes more. And it does not load the Palm, who was fresh off for, oh, maybe a year.
So I have always used the Palm Desktop program, to keep track of my phone numbers, etc. Well, my cat has sprayed the pc, and I had to get a new one. Meanwhile, with the short circuits happened, the program opens not right. I copied what I thought, it was user files, reinstalled Palm Desktop and am open program, HOWEVER, the user box comes back as it is a brand new user and does not recognize when I paste the files in the directory!
How can I recover my address book? I don't like on all other data, but I NEED something like that!
Thanks in advance.
You have a backup file called address.dat or address.bak. If this isn't the case, then your data are most likely missing. Search your PC or the other of these two files.
Message relates to: None
-
How can I recover my data from the C drive program folder?
It has been deleted accidentally and therefore, the necessary tools for MySQL etc are no longer available. Also I can't access administrative tools of the control panel may be for this reason.
If it's not in your recycle bin and you have no backup of the image, then... oh dear :(
-
How can I use a date in the format YYYYMMDD "" to calculate an age?
I do a form and I want to use a military format "YYYYMMDD" date to calculate the age of the user. I found the code to find the age based on a date in the format "yyyy/mm/dd", but I have trouble finding the age after adding slashes with javascript after the date input. I use Adobe Acrobat Pro DC on OSX 10.11.6. Thanks in advance.
Replace these two lines:
var cDob is getField (cBirthDate) .value;.
var cCutoff is getField (cCutoffDate) .value;.
With this:
var cDob is getField (cBirthDate) .valueAsString;.
var cCutoff is getField (cCutoffDate) .valueAsString;.
-
How can I restore my data with the recovery firefox key?
So, my laptop was recently reimagee. I was able to get a recovery key Firefox before everything has been removed. When I downloaded Firefox on the recreated machine, asked me to connect. After several resets the password, I have been in. None of my data came down from the cloud "firefox". It does give me an option to enter the recovery key. Is it possible to recover all my stuff?
Firefox sync was never to be a backup service, you should always have a printed copy of your data.
You can do it, although there is no guarantee that it will work.
- Download firefox ftp://ftp.mozilla.org/pub/firefox/releases/28.0/win32/en-US/28.
- Do not stay on 28, it's not safe, but we will use it to retrieve your old data sync
- Use your recovery key to connect to your sync account, see if you can download your data. If it works, please do the next step
- Upgrade to Firefox 30 Update Firefox to the latest version
- Update to the new Sync synchronize your bookmarks from Firefox, history, passwords, etc.
-
How can I remove unwanted data from the iCloud?
I get iCloud storage is declining full one Apple. I need to remove unnecessary data, but links to this issue of support continue to "implement the iCloud account. Obviously, I have an account, but need to delete old data.
The following can help: manage your iCloud - Apple Support storage space
-
How can I store a setting of the screen. Windows 7
When I study a book I wish I had the Kindle program on the left side of the screen, while I OneNote on the right side of the screen. Is there a way I can remember this configuration and raise it in a single click without reconfigure every time? Thanks for your help
Hello
Thanks for posting your query in Microsoft Community Forum.
Windows remembers the size of any program or any closed last page and when restart you the same program, it will launch the same size the last time you closed.
You can click with the right button on the task bar and select the two options for the number of pages that will be held side by side or stacked. However, you must open the programs/pages and then you will have to make every time right click on the task bar > Show Windows stacked or Windows side by side
Hope this information is useful.
Do not hesitate to write to us in case you have any problems/concerns while working on your computer, we will be happy to help you.
Thank you.
-
I just got a new computer, connected to my account, installed the game and my progress is not there. I don't like all that actually stay in sync on both I want to just transfer as I am to get rid of my old computer.
Hi Alex,
Unfortunately, you will not be able to synchronize the progress of a game on a different computer. When you use the application on another computer, it will be installed as a new.
-
How can I add an ISO to the data store?
How can I add an ISO to the data store? It doesn't let me access the ISO.
of the error, it seems that your iso is bad.
hitting a md5 checksum or re-download the iso
-
How can I remove an application from the App Store in the section update application?
How can I remove an application from the App Store in the section update application?
You can not delete Apps from the update tab. It's just a list
The list is just for information purposes. Finally, they are deleted from the list on their own.
-
I UNDERSTAND THAT MICROSOFT MONEY VERSI0N 2011 IS DECOMMISSIONED. I AM HAPPYTO UPGRADE TO A NEWER VERSION, BUT A QUESTION AS TO HOW I CAN TRANSFER ALL DATA ON MSM 2001 TO THE NEW VERSION. WHAT WOUKLD NEW VERSION BE CALLED
original title: MISROSOFT MONEY VERSION2001original title: How can I transfer my data from Microsoft Money 2001 to a newer version?Hello
Check in the Microsoft Money Forum.
Microsoft Money - Forum
http://social.Microsoft.com/forums/en/money/threadsMicrosoft Money Solution Center - suggests alternatives
http://support.Microsoft.com/mnyWhat is Microsoft Money Plus sunset
http://support.Microsoft.com/kb/2118008BING - microsoft money replacement
http://www.bing.com/search?q=Microsoft+Money+replacement&go=&QS=n&SK=&SC=7-27&form=QBLHGoogle - microsoft money replacement
http://www.google.com/#sclient=psy-ab&hl=en&source=hp&q=microsoft+money+replacement&pbx=1&oq=microsoft+money+replacement&aq=f&aqi=g4&aql=&gs_sm=e&gs_upl=9978l11972l2l12926l12l1l0l0l0l0l467l467l4-1l1l0&bav=on.2,or.r_gc.r_pw.,cf.osb&fp=dcc84c4c7dd2e143&biw=1024&bih=681I hope this helps.
Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle="">-><- mark="" twain="" said="" it="">->
-
Using XP: I have only about 2 GB (2 000 MB) of the programs on my hard drive Go 37 and less than 3 GB of space left.
How can I find and open/search the 32 GB of data that fills the disk for possible deletion?
Thank you.
* original title - full hard drive. *
Using XP: I have only about 2 GB (2 000 MB) of the programs on my hard drive Go 37 and less than 3 GB of space left.
How can I find and open/search the 32 GB of data that fills the disk for possible deletion?
Thank you.
Download and run JDiskReport.
There are a number of things you can do to- temporarily - free up disk space. The only real solution, however, is to get a larger hard drive.
- You can run Disk Cleanup (start > run > cleanmgr > OK)
- You can reduce the size allocated for the restoration of the system to about 1 GB (right click on desktop > properties > system restore > settings)
- You can disable hibernation (if you don't use it) (right click on an empty spot on the desktop > properties > screen saver > power > Hibernate)
- You can disable the indexing of the drive, which will also speed up your computer a bit (http://lifehacker.com/031440/turn-off-indexing-and-speed-up-windows-xp)
- You can reduce the size of your Internet browser cache (depending on the browser that you use)
- You can remove most of the $NTUninstallKBxxxxxx files $ following the directions here: http://windowsxp.mvps.org/Hotfix_backup.htm (read the warnings in the gray box first)
But none of these answers you will earn really large amounts of space for very long. The term solution time is a bigger hard drive.
In the meantime, download and run JDiskReport, that will show you graphically what files take up more space and seem to so indicate what files to delete or uninstall applications.
-
I had to replace my old Windows XP 32 bit Office - new is 64-bit Windows 7. How can I get my data on my Memorex U3 1 GB player - can't seem to access the U3 passwork.
The system U3 portable applications on a USB key is no longer supported.
Check with
-
How much is the cloud service? In Swedish SEK? How can I store in the cloud? How can I find information in Swedish?
Hi rolllex
Please see this link for the composition of the creative plans plans cloud pricing and membership creative cloud | Adobe Creative Cloud, choose the currency to the link on the page.
Kind regards
Nicos
Maybe you are looking for
-
Satellite A210-1AO does not start
Hello I could use a little help. My 4 year old A210 1AO worked perfectly until today (except to change the HARD disk a few months before). Tonight, I tried to turn it on, but almost nothing happens. The light 'on' is on, the battery the power and lig
-
elitbook HP 2740 Important Bios
I downloaded this player ' HP Notebook System BIOS update VERSION: F.04 "of your Web site and after this set.The unit does not light Then the machine was not able to open any interface In this case, can someone help meSend me a valid BIOS update file
-
Event ID of diagnosis-perfomance: 100. Slow start
No recent changes. A boot suddenly dropped from 30 seconds to 3 minutes. Log name: Microsoft-Windows-Diagnostics-Performance/OperationalSource: Microsoft-Windows-Diagnostics-PerformanceDate: 2010-07-12 19:30:48Event ID: 100Task category: startup perf
-
Hello Eloqua community!I'm looking for a report that will give her me cancel the subscription emails from 10 or 15 global albums gave us. In other words, this e-mail had the highest rate of churn during the last month or X calendar. I see a report "T
-
I have a 722C Deskjet connected via a cable to a computer running Win XP on a network. I just added a new HP pavilion p2-1102 with Windows 7 on the network. Windows 7 sees the printer but will not install the driver because I can't use the USB port