Scaling and moving graphics paths
-
Hi all, hope you are having a bug free weekend! I have attempted to write a function which scales and translates a graphics path. If you describe a path as a square, I want to be able to draw your path twice...the first time using the size you specified in the path, then the second time I want to move it and reduce it (scale it down) by a specific number of pixels. I attempted to write code to do this, but I fear my limited mathematical abilities are whats causing me to see rather odd results in size and position. The thing is I DO NOT want to reduce the second drawn path by a percentage. I want to move it in by X,Y pixels then of course reduce its width by X*2 pixels and Y*2 pixels, so that the second shape always stays centralised with respect to the first. What this would mean is that I can have user defined button shapes, where I can maintain somekind of consistent look with pre-programmed rectangular and circular buttons which have gradient filled borders. Can anybody offer me some code which produces a matrix that causes a translation and appropriate scaling factors to produce the required results? I think I only need the code to set the appropriate matrix properties, so you don't need to give me a big story. I will look at your code and probably see where my own is lacking. Thanks in advance. Nursey. Nursey