Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

AndroidÔ­Éú(Native)C¿ª·¢Ö®Èý£ºÊó±êʼþƪ(²¶Êó¼Ç)


ÔÚ×öSDLÖÁAndroidµÄÒÆֲʱ£¬¼üÅÌʼþÊÇÄÜÕý³£²¶»ñµ½£¬¿´ÁËSLDµÄÔ´Â룬·¢ÏÖÓõÄdeviceÊÇ /dev/tty0£¬µ«ÊÇÊó±ê½ÐÊDz»Äܳɹ¦²¶»ñ£¬×ÜÊǵõ½ 0£¬ÔËÐÐÃüÁî²é¿´devicesʱ£¬ÏÔʾÈçÏ£º
 # cat /proc/bus/input/devices
cat /proc/bus/input/devices
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="qwerty"
P: Phys=
S: Sysfs=/class/input/input0
U: Uniq=
H: Handlers=kbd mouse0 event0
B: EV=2f
B: KEY=ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff f
fffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe
B: REL=3
B: ABS=7
B: SW=1
½øÈë /dev/input Ŀ¼£¬·¢ÏÖÔÚ3¸ödeviceÎļþ£ºmice,mouse0,event0£¬·Ö±ð catÕâ3¸öÎļþ£¬·¢ÏÖÖ»ÓÐ event0 Óз´Ó¦£¬ÈçÏÂͼ£º
¶øÇÒ²»¹ÜÊǵã»÷Êó±ê»¹ÊÇ°´¼ü£¬¶¼Óз´Ó¦£¬µ«ÏÔʾµÄÊÇÒ»¶ÑÂÒÂ룬¶øÇÒµã»÷Êó±ê³öÀ´µÄ¶«Î÷Òª¶àÒ»µã£¬ÄѵÀÕâ¾ÍÊÇ´«ËµÊÇµÄ touchscreen £¿£¡
ΪÁË·ÖÎö event0 µÄ·µ»ØÖµ£¬Ð´ÁËÒ»¶Î´úÂë testmice.c£¬ÈçÏ£º
 #include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <linux/input.h>
static int event0_fd = -1;
struct input_event ev0[64];
//for handling event0, mouse/key/ts
static int handle_event0() {
    int button = 0, realx = 0, realy = 0, i, rd;
    rd = read(event0_fd, ev0, sizeof(struct input_event) * 64);
    if ( rd < sizeof(struct input_event) ) return 0;
    for (i = 0; i < rd / sizeof(struct input_event); i++) {
        printf("", ev0[i].type, ev0[i].code, ev0[i].value);
        if (ev0[i].type == 3 && ev0[i].code == 0)
            realx = ev0[i].value;
        else if (ev0[i].type == 3 && ev0[i].code == 1)
            realy = ev0[i].value;
        else if (ev0[i].type == 1) {
       


Ïà¹ØÎĵµ£º

ÈçºÎÔÚLinuxʹÓÃEclipse + CDT¿ª·¢C/C++³ÌÐò?

A. ΪʲôҪÔÚLinuxʹÓÃEclipse¿ª·¢C/C++³ÌÐò?
LinuxÊÇÒ»¸öÒÔC/C++¿ª·¢ÎªÖ÷µÄƽ̨£¬ÎÞÂÛÊÇKernel»òÊÇApplication£¬Ö÷Òª¶¼Ê¹ÓÃC/C++¿ª·¢¡£´«Í³ÔÚLinuxÏ¿ª·¢³ÌÐò£¬ÊÇÔÚÎÄ×ÖģʽÏ£¬ÀûÓÃviµÈÎÄ×ֱ༭Æ÷׫дC/C++³ÌÐò´æÅ̺ó£¬ÔÚCommand lineÏÂʹÓÃgcc±àÒ룬ÈôÒªdebug£¬ÔòʹÓÃgdb¡£
ÕâÖÖ¿ª·¢·½Ê½Éú²úÁ¦²¢²»¸ß£¬ÈôÖ»ÊÇ¿ª·¢Ñ§ ......

±ê×¼c(c89,c99)Ô­À´²»Ö§³Öȱʡ²ÎÊý

±àÒëÒ»¸öͼÏó½Ó¿Ú¿â£¬ÆäÖÐÓõ½cvSaveImage( out_img_name, img); ±àÒ뱨´í£º
too few arguments to function cvSaveImage
Ò»ÏÂ×ӾͺýÍ¿ÁË£¬´ÓÀ´¶¼ÊÇÕâôÓà cvSaveImage µÄ¡£highgui.hÀïµÄº¯ÊýÔ­ÐÍÒ²ÊǶ¨ÒåÁËȱʡµÄ£¬
CVAPI(int) cvSaveImage(const char*  filename, const CvArr* image, const int* params CV_DEFA ......

C ³ÌÐòµÄÍⲿ±äÁ¿Ó뺯Êý

±¾ÎÄÌÖÂÛÁËC³ÌÐòµÄÍⲿ±äÁ¿ºÍº¯ÊýµÄһЩÐÔÖÊ£¬½áºÏʵ¼ÊµÄ±à³Ì£¬¸ø³öÁËʹÓÃÍⲿ±äÁ¿ºÍº¯ÊýµÄ·½·¨¡£
¹Ø¼ü×Ö£ºC³ÌÐò£¬Íⲿ±äÁ¿£¬º¯Êý
¡¡¡¡C³ÌÐòÓÉÒ»×é¶ÔÏó×é³É£¬ÕâЩ¶ÔÏó°üÀ¨³ÌÐòÖÐËùʹÓõıäÁ¿ºÍʵÏÖÌض¨¹¦Äܵĺ¯Êý¡£±äÁ¿¿ÉÒÔ·ÖΪº¯ÊýÄÚ²¿¶¨Ò塢ʹÓõıäÁ¿ºÍº¯ÊýÍⲿ¶¨ÒåµÄ±äÁ¿£¬Í¨³£Çé¿öÏ£¬°Ñº¯ÊýÄÚ²¿¶¨Ò塢ʹÓõıäÁ¿³ÆÎ ......

CºÍC++ÖеÄÖ÷ÒªÊý¾ÝÀàÐͺÍ×Ö½Ú´óС

CºÍC++ÖеÄÖ÷ÒªÊý¾ÝÀàÐͺÍ×Ö½Ú´óС(
    C/C++µÄд·¨ÊDz»¿ÆѧºÍ²»ÑϽ÷µÄ¡£ÒòΪCºÍC++ËäÈ»ÓïÒ壬µ«ÊÇÉè¼Æ˼ÏëÊǽṹ»¯ÓëÃæÏò¶ÔÏó. C±ê×¼¹æ·¶ÓëC++µÄ±ê×¼¹æ·¶Ò²ÊÇÁ½¸öÎı¾¡£½üÀ´×ÐϸÑо¿ÁËËüÃǵÄÊý¾ÝÀàÐÍ£¬²ÅÖªµÀÆäÀ´ÁúÈ¥Âö£¬ÕæÕý×öµ½ÆäʵËùÒÔÈ»¡£
1¡¢CÓïÑÔ¶¨ÒåÁË5ÖÖ»ù±¾Êý¾ÝÀàÐÍ
  char(×Ö·û), int(Õ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ