mesaglam / alivepdf

Automatically exported from code.google.com/p/alivepdf
0 stars 0 forks source link

addImage method signature #29

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I am wondering why the method signature of addImage is the way it is.
Because there is no method overloading in actionscript, I always feel the
most used parameters should go first.  In the case of addImage, I would
think that the parameters related to positioning and size are more often
changed than blend mode, etc..  Unfortunately, currently to change the
position and size one has to set almost all the other parameters.  Would it
be better to change the method argument order to this:

public function addImage ( pDisplayObject:DisplayObject, pX:Number=0,
pY:Number=0, pWidth:Number=0, pHeight:Number=0, pLink:String='', 
pAlpha:Number=1, pBlend:String="Normal", pMatrix:Matrix=null,
pResizePage:Boolean=false, pEncoding:String="JPG", pQuality:Number=100 ):void

this would allow for the following simplicity in adding an image:

myPDF.addImage(logo,100,400,100,100);

or if you don't need to scale...

myPDF.addImage(logo,100,400);

Just food for thought.  I don't know how other's feel.

- Kevin

Original issue reported on code.google.com by heythere...@gmail.com on 30 Jan 2008 at 9:48

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
hi kevin,

yes that is true, I will move all the extra parameters like matrix, blend modes,
encoding etc at the end.

easier and looks better ;)

nice idea,

thanks ;)

Thibault

Original comment by thibault.imbert on 30 Jan 2008 at 6:24