Re: [Flashcoders] How to smooth bitmap?

2009-04-17 Thread Karl DeSaulniers

You could try this one.
This is an imageLoader class that smooths dynamic images.
Dont know about the whole security issue though.
This loads the initial image into a MC, then deletes it, then draws  
the bitmap into another MC.

GL

By martijndevisser.




Karl DeSaulniers
Design Drumm
http://designdrumm.com



On Apr 17, 2009, at 12:36 AM, Pavel Repkin wrote:


Yes, I can, it does not work either :-(

On Wed, Apr 15, 2009 at 7:48 PM, Anthony Pace  
anthony.p...@utoronto.cawrote:



Can you put the bitmap inside a movie clip, and get pixel data from a
parent to make a new bitmapdata object?

It seems like that would enable you to get around that problem;  
yet, again,
I haven't played with this, nor do I have time to unfortunately,  
so I am not

sure.


Pavel Repkin wrote:


Thanks, I've already written this code by myself.

Unfortunately, it does not work because of security issues.
You are not allowed to use BitmapData.draw to retrieve pixels  
containing

media from a domain other than your own.


On Mon, Apr 13, 2009 at 8:34 PM, Ian Thomas i...@eirias.net wrote:




Alternatively, just copy the bitmap and smooth it:

http://code.awenmedia.com/node/27

HTH,
  Ian

On Sat, Apr 11, 2009 at 3:16 PM, Pavel Repkin  
pavel.rep...@gmail.com

wrote:



Hey!

I have a bitmap image loaded from external site (Facebook user  
avatar).
Its size is 50x50 pixels and it looks very pixelated when the  
Flash

Stage
size changes.
The image would look much better if it was smoothed.

But, smoothing does not work for images loaded from external  
domains.

MovieClip.forceSmoothing = true just does not work.
However if the image resides on the same server as the script,  
smoothing

works like a charm.

Do you know how can I smooth the bitmap?
Is it possible?

AS 2.0, FP 9.0

Pasha.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] How to smooth bitmap?

2009-04-17 Thread Karl DeSaulniers

I am sorry I forgot I can not post files to the list.
my apologies, I am new to the list... :D

Here is the code. Make an .as file with this in it:

//-- Start Code

import flash.display.BitmapData;

/**
 * Class to load images with that will be automatically smoothed,  
workaround for the Flash Player 8 non smoothing 'feature' for loaded  
images

 * @author Martijn de Visser
 * @usage
 * 1. var loader:ImageLoader = new ImageLoader(this);
 * 2. loader.loadImage( “some_image.jpg”, some_mc );
 */
class com.martijndevisser.ImageLoader {

private var mLoader:MovieClipLoader;

public function ImageLoader(targetMc:MovieClip) {
targetMc.mcLoader = new MovieClipLoader();
mLoader = targetMc.mcLoader;
addListener(this);
}
/**
 * Pass along any events from internally used MovieClipLoader
 */
public function addListener(inListener:Object) {

mLoader.addListener(inListener);
}
public function removeListener(inListener:Object) {

mLoader.removeListener(inListener);
}
/**
 * Triggered by MovieClipLoader
 */
private function onLoadInit(inTarget:MovieClip):Void {

// create new BitMap data object and
// draw the loaded bitmap in new bitmap
		var bitmap:BitmapData = new BitmapData(inTarget._width,  
inTarget._height, true, 0x00);

bitmap.draw(inTarget);

// create a new movieclip to display the bitmap with
var parent:MovieClip = inTarget._parent;
		var img:MovieClip = parent.createEmptyMovieClip 
(imageloader_smooth_mc, parent.getNextHighestDepth());


// remove original bitmap
inTarget.unloadMovie();
inTarget.removeMovieClip();
delete inTarget;

// draw BitMap in new clip, using the 'smoothing' flag
img.attachBitmap(bitmap,img.getNextHighestDepth(),auto,true);
}
/**
 * Starts loading an image.
 */
var mProgress:Number;
public function loadImage(inImage:String, inTarget:MovieClip):Void {

// create mc to load bitmap in
		var raw:MovieClip = inTarget.createEmptyMovieClip 
(imageloader_raw_mc, inTarget.getNextHighestDepth());


// start loader
mLoader.loadClip(inImage,raw);
}
/**
 * @return Package and class name
 */
public function toString():String {
return ImageLoader;
}
}

//- End of code

Karl DeSaulniers
Design Drumm
http://designdrumm.com

On Apr 17, 2009, at 1:41 AM, Karl DeSaulniers wrote:


You could try this one.
This is an imageLoader class that smooths dynamic images.
Dont know about the whole security issue though.
This loads the initial image into a MC, then deletes it, then draws  
the bitmap into another MC.

GL

By martijndevisser.



Karl DeSaulniers
Design Drumm
http://designdrumm.com



On Apr 17, 2009, at 12:36 AM, Pavel Repkin wrote:


Yes, I can, it does not work either :-(

On Wed, Apr 15, 2009 at 7:48 PM, Anthony Pace  
anthony.p...@utoronto.cawrote:


Can you put the bitmap inside a movie clip, and get pixel data  
from a

parent to make a new bitmapdata object?

It seems like that would enable you to get around that problem;  
yet, again,
I haven't played with this, nor do I have time to unfortunately,  
so I am not

sure.


Pavel Repkin wrote:


Thanks, I've already written this code by myself.

Unfortunately, it does not work because of security issues.
You are not allowed to use BitmapData.draw to retrieve pixels  
containing

media from a domain other than your own.


On Mon, Apr 13, 2009 at 8:34 PM, Ian Thomas i...@eirias.net wrote:




Alternatively, just copy the bitmap and smooth it:

http://code.awenmedia.com/node/27

HTH,
  Ian

On Sat, Apr 11, 2009 at 3:16 PM, Pavel Repkin  
pavel.rep...@gmail.com

wrote:



Hey!

I have a bitmap image loaded from external site (Facebook user  
avatar).
Its size is 50x50 pixels and it looks very pixelated when the  
Flash

Stage
size changes.
The image would look much better if it was smoothed.

But, smoothing does not work for images loaded from external  
domains.

MovieClip.forceSmoothing = true just does not work.
However if the image resides on the same server as the script,  
smoothing

works like a charm.

Do you know how can I smooth the bitmap?
Is it possible?

AS 2.0, FP 9.0

Pasha.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Re: [Flashcoders] How to smooth bitmap?

2009-04-17 Thread Pavel Repkin
Because of the very very security issue I cannot use this code.
You are not allowed to use BitmapData.draw to retrieve pixels containing
media from a domain other than your own.

On Fri, Apr 17, 2009 at 10:41 AM, Karl DeSaulniers k...@designdrumm.comwrote:

 You could try this one.
 This is an imageLoader class that smooths dynamic images.
 Dont know about the whole security issue though.
 This loads the initial image into a MC, then deletes it, then draws the
 bitmap into another MC.
 GL

 By martijndevisser.

 


 Karl DeSaulniers
 Design Drumm
 http://designdrumm.com




 On Apr 17, 2009, at 12:36 AM, Pavel Repkin wrote:

  Yes, I can, it does not work either :-(

 On Wed, Apr 15, 2009 at 7:48 PM, Anthony Pace anthony.p...@utoronto.ca
 wrote:

  Can you put the bitmap inside a movie clip, and get pixel data from a
 parent to make a new bitmapdata object?

 It seems like that would enable you to get around that problem; yet,
 again,
 I haven't played with this, nor do I have time to unfortunately, so I am
 not
 sure.


 Pavel Repkin wrote:

  Thanks, I've already written this code by myself.

 Unfortunately, it does not work because of security issues.
 You are not allowed to use BitmapData.draw to retrieve pixels containing
 media from a domain other than your own.


 On Mon, Apr 13, 2009 at 8:34 PM, Ian Thomas i...@eirias.net wrote:



  Alternatively, just copy the bitmap and smooth it:

 http://code.awenmedia.com/node/27

 HTH,
  Ian

 On Sat, Apr 11, 2009 at 3:16 PM, Pavel Repkin pavel.rep...@gmail.com
 wrote:


  Hey!

 I have a bitmap image loaded from external site (Facebook user
 avatar).
 Its size is 50x50 pixels and it looks very pixelated when the Flash
 Stage
 size changes.
 The image would look much better if it was smoothed.

 But, smoothing does not work for images loaded from external domains.
 MovieClip.forceSmoothing = true just does not work.
 However if the image resides on the same server as the script,
 smoothing
 works like a charm.

 Do you know how can I smooth the bitmap?
 Is it possible?

 AS 2.0, FP 9.0

 Pasha.
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



  ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



  ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



  ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

  ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] How to smooth bitmap?

2009-04-16 Thread Pavel Repkin
Yes, I can, it does not work either :-(

On Wed, Apr 15, 2009 at 7:48 PM, Anthony Pace anthony.p...@utoronto.cawrote:

 Can you put the bitmap inside a movie clip, and get pixel data from a
 parent to make a new bitmapdata object?

 It seems like that would enable you to get around that problem; yet, again,
 I haven't played with this, nor do I have time to unfortunately, so I am not
 sure.


 Pavel Repkin wrote:

 Thanks, I've already written this code by myself.

 Unfortunately, it does not work because of security issues.
 You are not allowed to use BitmapData.draw to retrieve pixels containing
 media from a domain other than your own.


 On Mon, Apr 13, 2009 at 8:34 PM, Ian Thomas i...@eirias.net wrote:



 Alternatively, just copy the bitmap and smooth it:

 http://code.awenmedia.com/node/27

 HTH,
   Ian

 On Sat, Apr 11, 2009 at 3:16 PM, Pavel Repkin pavel.rep...@gmail.com
 wrote:


 Hey!

 I have a bitmap image loaded from external site (Facebook user avatar).
 Its size is 50x50 pixels and it looks very pixelated when the Flash
 Stage
 size changes.
 The image would look much better if it was smoothed.

 But, smoothing does not work for images loaded from external domains.
 MovieClip.forceSmoothing = true just does not work.
 However if the image resides on the same server as the script, smoothing
 works like a charm.

 Do you know how can I smooth the bitmap?
 Is it possible?

 AS 2.0, FP 9.0

 Pasha.
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] How to smooth bitmap?

2009-04-15 Thread Pavel Repkin
Thanks, I've already written this code by myself.

Unfortunately, it does not work because of security issues.
You are not allowed to use BitmapData.draw to retrieve pixels containing
media from a domain other than your own.


On Mon, Apr 13, 2009 at 8:34 PM, Ian Thomas i...@eirias.net wrote:

 Alternatively, just copy the bitmap and smooth it:

 http://code.awenmedia.com/node/27

 HTH,
Ian

 On Sat, Apr 11, 2009 at 3:16 PM, Pavel Repkin pavel.rep...@gmail.com
 wrote:
  Hey!
 
  I have a bitmap image loaded from external site (Facebook user avatar).
  Its size is 50x50 pixels and it looks very pixelated when the Flash Stage
  size changes.
  The image would look much better if it was smoothed.
 
  But, smoothing does not work for images loaded from external domains.
  MovieClip.forceSmoothing = true just does not work.
  However if the image resides on the same server as the script, smoothing
  works like a charm.
 
  Do you know how can I smooth the bitmap?
  Is it possible?
 
  AS 2.0, FP 9.0
 
  Pasha.
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] How to smooth bitmap?

2009-04-15 Thread Anthony Pace
Can you put the bitmap inside a movie clip, and get pixel data from a 
parent to make a new bitmapdata object?


It seems like that would enable you to get around that problem; yet, 
again, I haven't played with this, nor do I have time to unfortunately, 
so I am not sure.


Pavel Repkin wrote:

Thanks, I've already written this code by myself.

Unfortunately, it does not work because of security issues.
You are not allowed to use BitmapData.draw to retrieve pixels containing
media from a domain other than your own.


On Mon, Apr 13, 2009 at 8:34 PM, Ian Thomas i...@eirias.net wrote:

  

Alternatively, just copy the bitmap and smooth it:

http://code.awenmedia.com/node/27

HTH,
   Ian

On Sat, Apr 11, 2009 at 3:16 PM, Pavel Repkin pavel.rep...@gmail.com
wrote:


Hey!

I have a bitmap image loaded from external site (Facebook user avatar).
Its size is 50x50 pixels and it looks very pixelated when the Flash Stage
size changes.
The image would look much better if it was smoothed.

But, smoothing does not work for images loaded from external domains.
MovieClip.forceSmoothing = true just does not work.
However if the image resides on the same server as the script, smoothing
works like a charm.

Do you know how can I smooth the bitmap?
Is it possible?

AS 2.0, FP 9.0

Pasha.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

  

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

  

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] How to smooth bitmap?

2009-04-13 Thread Ian Thomas
Alternatively, just copy the bitmap and smooth it:

http://code.awenmedia.com/node/27

HTH,
   Ian

On Sat, Apr 11, 2009 at 3:16 PM, Pavel Repkin pavel.rep...@gmail.com wrote:
 Hey!

 I have a bitmap image loaded from external site (Facebook user avatar).
 Its size is 50x50 pixels and it looks very pixelated when the Flash Stage
 size changes.
 The image would look much better if it was smoothed.

 But, smoothing does not work for images loaded from external domains.
 MovieClip.forceSmoothing = true just does not work.
 However if the image resides on the same server as the script, smoothing
 works like a charm.

 Do you know how can I smooth the bitmap?
 Is it possible?

 AS 2.0, FP 9.0

 Pasha.
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] How to smooth bitmap?

2009-04-11 Thread Pavel Repkin
Thanks, Latcho!

Inside discussions over BitmapData.draw() on Flash-help site I've found this
script
?php
$file = $_GET[file];
header(Content-Type: image/jpg);
readfile($file);
?

But it looks very insecure.
Do you know a proper one with correct input checking?
I'm a new to PHP and it's hard for me to make this script secure.

Yes, there is the crossdomain.xml on Facebook, but it opens Facebook for a
small set of domains, mostly of them are Facebook servers. Have a look
facebook.com/crossdomain.xml

Of course there are several Facebook APIs, but the ones I've seen do nothing
special about image download. Though they help to easily access image url.
And, as far as I know, there are no official Facebook Flash API.


On Sat, Apr 11, 2009 at 7:29 PM, Latcho spamtha...@gmail.com wrote:

 I'm afraid that you need to implement a proxy script on your own server
 that loads the image from facebook.
 But isn't there a crossdomain.xml to load from FB ? Or isn't there an API
 (yet) ?
 Latcho

 Pavel Repkin wrote:

 Hey!

 I have a bitmap image loaded from external site (Facebook user avatar).
 Its size is 50x50 pixels and it looks very pixelated when the Flash Stage
 size changes.
 The image would look much better if it was smoothed.

 But, smoothing does not work for images loaded from external domains.
 MovieClip.forceSmoothing = true just does not work.
 However if the image resides on the same server as the script, smoothing
 works like a charm.

 Do you know how can I smooth the bitmap?
 Is it possible?

 AS 2.0, FP 9.0

 Pasha.
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] How to smooth bitmap?

2009-04-11 Thread Patrick Matte
Here's a facebook API.

http://code.google.com/p/facebook-actionscript-api/




 From: Pavel Repkin pavel.rep...@gmail.com
 Reply-To: Flash Coders List flashcoders@chattyfig.figleaf.com
 Date: Sat, 11 Apr 2009 20:28:14 +0400
 To: spamtha...@gmail.com, Flash Coders List
 flashcoders@chattyfig.figleaf.com
 Subject: Re: [Flashcoders] How to smooth bitmap?
 
 Thanks, Latcho!
 
 Inside discussions over BitmapData.draw() on Flash-help site I've found this
 script
 ?php
 $file = $_GET[file];
 header(Content-Type: image/jpg);
 readfile($file);
 ?
 
 But it looks very insecure.
 Do you know a proper one with correct input checking?
 I'm a new to PHP and it's hard for me to make this script secure.
 
 Yes, there is the crossdomain.xml on Facebook, but it opens Facebook for a
 small set of domains, mostly of them are Facebook servers. Have a look
 facebook.com/crossdomain.xml
 
 Of course there are several Facebook APIs, but the ones I've seen do nothing
 special about image download. Though they help to easily access image url.
 And, as far as I know, there are no official Facebook Flash API.
 
 
 On Sat, Apr 11, 2009 at 7:29 PM, Latcho spamtha...@gmail.com wrote:
 
 I'm afraid that you need to implement a proxy script on your own server
 that loads the image from facebook.
 But isn't there a crossdomain.xml to load from FB ? Or isn't there an API
 (yet) ?
 Latcho
 
 Pavel Repkin wrote:
 
 Hey!
 
 I have a bitmap image loaded from external site (Facebook user avatar).
 Its size is 50x50 pixels and it looks very pixelated when the Flash Stage
 size changes.
 The image would look much better if it was smoothed.
 
 But, smoothing does not work for images loaded from external domains.
 MovieClip.forceSmoothing = true just does not work.
 However if the image resides on the same server as the script, smoothing
 works like a charm.
 
 Do you know how can I smooth the bitmap?
 Is it possible?
 
 AS 2.0, FP 9.0
 
 Pasha.
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 
 
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



This e-mail is intended only for the named person or entity to which it is 
addressed and contains valuable 
business information that is proprietary, privileged, confidential and/or 
otherwise protected from disclosure.

If you received this e-mail in error, any review, use, dissemination, 
distribution or copying of this e-mail 
is strictly prohibited. Please notify us immediately of the error via e-mail to 
disclai...@tbwachiat.com and 
please delete the e-mail from your system, retaining no copies in any media. We 
appreciate your cooperation.

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders