Ä«¸Þ¶ó ÇÁ¸®ºä ¿µ»ó À§ NDK¸¦ »ç¿ëÇÏ¿© °ªÀ» ¹Þ¾Æ¼ onDrawÇØÁÖ´Â ¹ÙÄÚµå ÀÎ½Ä ÇÁ·Î±×·¥À» ¸¸µé°í ÀÖ½À´Ï´Ù
¹®Á¦´Â ½Ç½Ã°£ 󸮰¡ µÇÁö ¾Ê°í ÇÁ¸®ºä ¿µ»óº¸´Ù 0.5ÃÊ Á¤µµ ´À¸®°Ô ÀÛµ¿À» ÇÕ´Ï´Ù
°è»ê·® ¹®Á¦·Î º¸±â¿£ ½ÉÇÏ°Ô ´À¸°°Å °°¾Æ¼ ¿©Â庾´Ï´Ù.
//¿Âµå·Î¿ì ºÎºÐ-----------------------------------------------------------------------------
public void onDraw(Canvas c) {
int[] x = new int[4], y = new int[4];
//ȸ鿡 ±×¸± ±Û¾¾ ¼Ó¼º
Paint Pnt = new Paint();
String s;
//ÀÎ½ÄµÈ ÄÚµå °³¼ö ±¸Çϱâ
countCode = main.getCount();
for (int i = 0; i < countCode; i++) {
x = main.getXA(i);
y = main.getYA(i);
Pnt.setColor(Color.GREEN);
c.drawRect((int)((double)(x[0])*0.75), (int)((double)(y[0]*0.666)), (int)((double)(x[0]*0.75))+5, (int)((double)(y[0]*0.666))+5, Pnt);
Pnt.setColor(Color.RED);
c.drawRect((int)((double)(x[1])*0.75), (int)((double)(y[1]*0.666)), (int)((double)(x[1]*0.75))+5, (int)((double)(y[1]*0.666))+5, Pnt);
Pnt.setColor(Color.YELLOW);
c.drawRect((int)((double)(x[2])*0.75), (int)((double)(y[2]*0.666)), (int)((double)(x[2]*0.75))+5, (int)((double)(y[2]*0.666))+5, Pnt);
Pnt.setColor(Color.GRAY);
c.drawRect((int)((double)(x[3])*0.75), (int)((double)(y[3]*0.666)), (int)((double)(x[3]*0.75))+5,(int)((double)( y[3]*0.666))+5, Pnt);
Pnt.setColor(Color.WHITE);
//c.drawRect(238, 158, 242, 162, Pnt);
s = main.getS(i);
//±Û¾¾»ö
Pnt.setColor(Color.CYAN);
//±Û¾¾ Å©±â
Pnt.setTextSize(25);
//ÄÚµåÀÇ µ¥ÀÌÅ͸¦ ÄÚµå À§Ä¡ÀÇ ¸ð¼¸®¿¡ ±×¸®±â
c.drawText(s, (int)((double)(main.getX(i)) * 0.75), (int)((double)(main.getY(i)) * 0.666), Pnt);
}
}//---------------------------------------------------------------------------------------
PreviewCallback previewcallback = new PreviewCallback() {
public void onPreviewFrame(byte[] data, Camera camera) {
/*
for(int i=0; i<480; i++) {
for(int j=0; j<640; j++) {
//gray°ªÀ¸·Î ÀúÀå
grayData[i*jb.WIDTH+j] = (byte)(data[i*jb.WIDTH+j]);
}
}
int ccc = jb.yuvtorgb(data);
//AR ¾÷µ¥ÀÌÆ®
jb.vw.invalidate();
}
};//------------------------------------------------------------------------------------
¾îµð°¡ ¹®Á¦°í ¾î¶² ºÎºÐÀ» ¹Ù²ã¾ß ÇÒÁö ¾Ë·ÁÁÖ¼¼¿ä
* ±ÛÀ» µî·ÏÇϽǶ§ ²À ÇÊ¿äÇÑ °æ¿ì°¡ ¾Æ´Ï¸é °³ÀÎÁ¤º¸¸¦ ³²±âÁö ¸¶¼¼¿ä ^^ (¿¬¶ôó,À̸ÞÀÏÁÖ¼Ò,Áֹεî·Ï¹øÈ£ µî)