How to use filters on ios mobile devices (iPhone/iPad) using GPU rendering (Solved)
Many moons ago I asked a question here on the forums about how to use filters (specifically a glow filter) on a mobile devices (specifically the iPhone) when using GPU rendering and high resolution.
At the time, there was no answer... filters were unsupported. Period.
Well, Thanks to a buddy of mine, this problem has been solved and I can report that I have gotten a color matrix filter for desaturation AND a glow filter working on the iPhone and the iPad using GPU rendering and high resolution.
The solution, in a nut shell is as follows:
1: Create your display object... ie: a sprite.
2. Apply your filter to the sprite like you normally would.
3. Create a new bitmapdata and then draw that display object into the bitmap data.
4. Put the new bitmapdata into a bitmap and then put it on the stage or do what you want.
When you draw the display object into the bitmapdata, it will draw it WITH THE FILTER!
So even if you put your display object onto the stage, the filter will not be visible, but the new bitmapdata will!
Here is a sample app I created and tested on the iphone and ipad
var bm:Bitmap;
// temp bitmap object
var bmData:BitmapData;
// temp bitmapData object
var m:Matrix;
// temp matrix object
var gl:GlowFilter;
// the glow filter we are going to use
var sprGL:Sprite;
// the source sprite we are going to apply the filter too
var sprGL2:Sprite;
// the sprite that will hold our final bitmapdata containing the original sprite with a filter.
// create the filters we are going to use.
gl = new GlowFilter(0xFF0000, 0.9, 10, 10, 5, 2, false, false);
// create the source sprite that will use our glow filter.
sprGL = new Sprite();
// create a bitmap with any image from our library to place into our source sprite.
bm = new Bitmap(new Msgbox_Background(), "auto", true);
// add the bitmap to our source sprite.
sprGL.addChild(bm);
// add the glow filter to the source sprite.
sprGL.filters = [gl];
// create the bitmapdata that will draw our glowing sprite.
sprGL2 = new Sprite();
// create the bitmap data to hold our new image... remember, with glow filters, you need to add the padding for the flow manually. Should be double the blur size
bmData = new BitmapData(sprGL.width+20, sprGL.height+20, true, 0);
// create a matrix to translate our source image when we draw it. Should be the same as our filter blur size.
m = new Matrix(1,0,0,1, 10, 10);
// draw the source sprite containing the filter into our bitmap data
bmData.draw(sprGL, m);
// put the new bitmap data into a bitmap so we can see it on screen.
bm = new Bitmap(bmData, "auto", true);
// put the new bitmap into a sprite - this is just because the rest of my test app needed it, you can probably just put the bitmap right on the screen directly.
sprGL2.addChild(bm);
// put the source sprite with the filter on the stage. It should draw, but you will not see the filter.
sprGL.x = 100;
sprGL.y = 50;
this.addChild(sprGL);
// put the filtered sprite on the stage. it shoudl appear like the source sprite, but a little bigger (because of the glow padding)
// and unlike the source sprite, the flow filter should acutally be visible now!
sprGL2.x = 300;
sprGL2.y = 50;
this.addChild(sprGL2);
Great stuff dave
I currently have a slider which changes the hue of an image in a movieclip, I need it to move through he full range -180 to 180.
I desperately need to get this working on a tablet but cant get the filters to work in GPU mode. My application works too slow in cpu mode.
var Mcolor:AdjustColor = new AdjustColor(); //This object will hold the color properties
var Mfilter:ColorMatrixFilter; //Will store the modified color filter to change the image
var markerSli:SliderUI = new SliderUI(stage, "x", markerSli.track_mc, markerSli.slider_mc, -180, 180, 0, 1); //using slider from http://evolve.reintroducing.com
Mcolor.brightness = 0; Mcolor.contrast = 0; Mcolor.hue = 0; Mcolor.saturation = 0; // Set initial value for filter
markerSli.addEventListener(SliderUIEvent.ON_UPDATE, markerSlider); // listen for slider changes
function markerSlider($evt:SliderUIEvent):void {
Mcolor.hue = $evt.currentValue;
updateM();
function updateM():void{
Mfilter = new ColorMatrixFilter(Mcolor.CalculateFinalFlatArray());
all.marker.filters = [Mfilter];
how would I use your solution in my case
many thanks.
Similar Messages
-
A friend of mine has an iPhone with a cellular data plan, a Macbook Pro, and a mini-iPad. She's been using Facetime, but says that all of the devices used to ring at the time of an incoming Facetime call. Now only her iPhone rings. How do you set whichever device you want to ring?
James: I agree. Please keep them shorter.
The answers to both questions are no.
The iPad is NOT a computer replacement. It is a mobile device.
The iPad can not stream tro the iPhone nor an iPod.
Hope this helps.... -
Hi there,
i have a problem i just don't get solved.
I have a Canon EOS 500d Camera that i also use to shoot videos every once in a while, but I dont get to transfer to my iPhone or iPad. But let me explain.
I import the Movies (1280x720) from the Camera just like the Pictures (mostly RAW) into iPhoto11 which works like a charm. I am also able to watch these Movies within iPhoto. Not a problem.
BUT. When i try to get them on my iPhone or iPad using iTunes, marking to sync Pics and Movies, it just doesn't work. It shows me an Error like: The following Movies/Videos couldn't be imported because the Format (.MOV) is unknown.
I am wondering if this Problem is known and how i can fix this?
This Problem does not occur w/ videos taken on the iPhone They get transferred to my mobile devices without any trouble.
I really hope that someone could help me w/ this issue.
Thank you very much,
MarkusHi,
thanks again.
How can you export movies (that already exist as .MOV-Files in iPhoto, but do not sync w/ iPad etc. as described above) from iPhoto then?
If you select one of the .MOV-Files within iPhoto and choose "Export..." (shift + cmd + E) and go to "Quicktime" the "Export"-Button is disabled. All other ways don't work either. This is just to Export PICTURES as in .JPG and else. Other wise you are very well invited to tell me how to export .mov-Files as Quicktime-Movie within iPhoto.
As for the "Save as...": I am sorry, you are right. Not available within iPhoto. I dragged one of the .MOV-Files on the Desktop, opened with Quicktime and then via "Save as..." or "Share"-> "iTunes..." transfer to iTunes. The Movie then shows up as "Movie" within iTunes and can be synced w/ iPhone etc.
There must be an easier way though. It is really a pain to workaround like this.
Still really looking forward to a solution.
Thanks again,
Markus
Message was edited by: Markus978 -
When I plug my iPod Touch 4g into my computer I get a pop-up that says "This iPod cannot be used because the Apple Mobile Device service is not started." And when I plug in my iTouch the name of the iTouch does not come up on my iTunes. How do I start the Apple Mobile Device? How do I fix this?
I'd start with the following document with that one:
iPhone, iPad, iPod touch: How to restart the Apple Mobile Device Service (AMDS) on Windows -
When connecting to Synch how do I fix "The iphone cannot be used because thr Apple Mobile device service is not started"
Refer to this article to restart AMDS:
How to restart the Apple Mobile Device Service (AMDS) on Windows
http://support.apple.com/kb/TS1567 -
I just got an iphone and am trying to connect it to my itunes account. Getting the message " This iphone cannot be used because the Apple Mobile Device service is not started. How do I start it? Have already been back to the store with it and no change.
http://tinyurl.com/3hs3g2u
-
I get a notice when trying to sync my iPad. "this iPad cannot be used because the Apple Mobile Device Service is not started".....What is this and how can I fix it? Help please
Here is a YouTube video which should guide you through a solution: http://www.youtube.com/watch?v=VLFAo-FWLxE
-
When I plug my iPod in my computer, "This iPod cannot be used because the Apple Mobile Device is not started" message pops up. What does this mean and how can I fix it?
Hello di_gitrdone,
Start with this article describing how to restart this service.
http://support.apple.com/kb/ts1567
B-rock -
When I try to sync my iPhone 4S with my computer, I get this message: "This iPhone cannot be used because the Apple mobile device service is not started" What does this mean, and how can I fix it?
means that apple mobile device service needs to be started try this article to get it turned back on
Restart apple mobile device service -
"this iPod cannot be used because the Apple Mobile Device service is not started" This message is shown when I plug in my iPod to iTunes. How do I fix this?
Type "Apple Mobile Device service" into the search bar at the top of this page by "Support"
-
When I plug my ipod touch into the pc, it tells me:the ipod cannot be used because the apple mobile device service is not started. What does this mean and how do I get rid of that and enable syncing?
Hello Julia,
Start with this article.
http://support.apple.com/kb/ts1567
B-rock -
itunes used to accept and sync ipod touch but all of a sudden it gives me a box that says it cannot be used because the apple mobile device service is not started.what is the mobile device service and how do i start it?
This tells you.
iPhone, iPad, iPod touch: How to restart the Apple Mobile Device Service (AMDS) on Windows -
When i plug in my ipod touch. I get the message, "this ipod cannot be used because the Apple Mobile Device service is not starte". How do i fix?
this support article about Apple Mobile Device Service may help.
-
Whenever I plug my iPod in the computer is comes up with this ..This iPod cannot be used because the Apple Mobile Device Service is not started. - what does this mean, how can i fix it?
Instructions here > iPod touch: How to restart the Apple Mobile Device Service (AMDS) on Windows
Or Mac > iTunes: How to remove and reinstall the Apple Mobile Device Service on Mac OS X -
When trying to sync my iPad my computer says this iPad cannot be used because the apple mobile device service is not started. How do I start the apple mobile device service?
Follow this article: How to restart the Apple Mobile Device Service (AMDS) on Windows
Maybe you are looking for
-
Adobe Bridge is barely working after my recent upgrade to Yosemite (my computer is an imac that is less than one year old, and is working perfectly in non-Adobe programs). It never ever acted up for me, not even once, before. I use it frequently as I
-
How do I restore lost iTunes from a crashed external hard drive?
My external hard drive that I used to store my downloaded cds has crashed and I was using iTunes to play my songs. Is it possible to recover my them? No backup was ever done.
-
Iv'e been going round and round with my iMac ever since Genius bar employees "upgraded" me to ML while replacing Seagate HD per the recall. THis is a late 2009 27-inch iMac that came with SL. What I think might solve this once and for all is to compl
-
X-fi xtreme audio pci-e help with an odd issue between xp and win 7
i upgraded to an x-fi xtreme audio pci express, now i dont have any issues with win xp, everything sounds fine, but when i do windows 7, i cant explain it any bettwe, the sounds are kind of muffled, even in my games, i cant explain it anymore then th
-
3rd gen iPod won't update or restore with iTunes 7
Ok, so my iPod has been kinda messed up for a while... it's getting a little older, and the battery is pretty much shot. During my last attempt at getting the iPod to sync with iTunes (a few weeks ago), I somehow managed to get it into disk mode, and