Site Sponsors:
Easy Backgrounds for Android 
I have developed a great respect for the developers of the Android Graphics Framework. Why? Because it is obvious that the developers like to use their classes, themselves.

It's Ragu!

Indeed, from doing complex things like affine transforms, to even simple things like measuring a Canvas or a Bitmap, Android has the data we need, when-we-need-it. -From splits to splines, it all seems to be "in there"! (The Company that makes Ragu Spaghetti Sauce had a commercial a few years back - many take the expression it's ragu to mean ''it's in there''!)


Such was thee case of having what we needed "in there" when we set our paws to spruce-up a little ditty we wrote for the Android Marketplace. When it came time to spread a tile image all over a background, we had what we needed. -So much so that we feel confident that what we wrote will be able to work across hand-held devices of infinite screen size. All because members are ragu, where & when they should be... and more:

public void draw(Canvas can) {
if (bmpBack != null) {
PixelCellMap map = new PixelCellMap(can.getWidth(), can.getHeight(), bmpBack.getWidth(), bmpBack.getHeight());
int iCells = map.getCellCount();
for (int ss = 0; ss < iCells; ss++) {
Point pt = map.getActual(ss);
can.drawBitmap(bmpBack, pt.x, pt.y, paintPaper);
} else {

Note that the PixelCellMap class is part of a forthcoming Open Source Toolkit. One we are creating for cross-platform Android / Swing / AWT portability. -If you want to learn more about it (the code-named for the graphical part of the framework is Vista (sorry - but that moniker just made the most sense at the moment)), then give us a holler.

[ view entry ] ( 2186 views )   |  permalink  |  related link

<<First <Back | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | Next> Last>>