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

ÔÚlinuxÏÂʹÓÃgtkµÄgdk

aishen944-163.com
תÌùÇë×¢Ã÷³ö´¦£¬Ð»Ð»£¡£¡
Æäʵ͸Ã÷ÌùͼµÄÔ­Àí¾ÍÊǽøÐÐxorÔËË㣬
»ù±¾¹«Ê½£ºA  xor A = 0    A xor 0 = A   A xor A xor B  = B
¼ÙÈçÏÖÔÚÓÐÁ½ÕÅͼƬ£¬Ò»ÕÅÊÇÎÒÃÇÒª¶ÔÆä½øÐÐÌùͼµÄͼƬA£¬ ÁíÍâÒ»ÕÅÊÇÒª±»ÌùͼµÄͼƬB
1£¬ ¸´ÖÆÍ¼Æ¬BµÄÒ»·Ý¿½±´ÎªC
2£¬ ½«CÖÐÖ¸¶¨µÄ±³¾°É«±äΪȫ°×(0xffffff)£¬ÆäËûÑÕÉ«±äΪȫºÚ(0x00)
3,     ÒÀ´ÎÖ´ÐÐÈçÏÂÔËËã:
        A  xor B
        A  and C
        A  xor B
        ¶ÔÓÚCÖеİ×ɫִÐÐÔËËãºóµÄ½á¹ûÈçÏÂ:
        ((A xor B) and 0xfffffff) xor B =  A xor B xor B =  A
        ¶ÔÓÚCÖеĺÚɫִÐÐÔËËãºóµÄ½á¹ûÈçÏÂ:
        ((A xor B) and 0x0000) xor B =  0 xor B = B
ÒÔÏÂÊÇ´úÂëʵÀý£¬Àý×ÓÖÐÓõ½µÄÁ½ÕÅͼƬÔÚÕâÀ
#include <cairo.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gtk/gtk.h>
static GdkPixbuf *bkpixbuf;
static GdkPixbuf *footballpixbuf;
static gboolean
on_expose_event (GtkWidget * widget,
GdkEventExpose * event, gpointer data)
{
cairo_t *cr;
cr = gdk_cairo_create (widget->window);
gdk_cairo_set_source_pixbuf(cr, bkpixbuf, 0, 0);
cairo_paint(cr);

cairo_destroy (cr);
return FALSE;
}
gboolean blttransparent(GdkPixbuf *dest, const GdkPixbuf *src, gint destx, gint desty, guint transcolor) {
GdkPixbuf *maskpixbuf = NULL; /* Ãɰå */
guchar *p = NULL, *dp = NULL, *sp = NULL;
gint x = 0, y = 0, i = 0;
/* ¼ì²éÄ¿µÄÇøÓò */
if(destx + gdk_pixbuf_get_width(src) >= gdk_pixbuf_get_width(dest) ||
desty + gdk_pixbuf_get_height(src) >= gdk_pixbuf_get_height(dest)) { /* ³¬³öÄ¿µÄ´óС, ʲôҲ²»×ö */
return TRUE;
}
/* ¼ì²éÑÕÉ«²ÉÑùÊý */
if(gdk_pixbuf_get_bits_per_sample(dest) != 8 ||
gdk_pixbuf_get_bits_per_sample(src) != 8) { // Ö»


Ïà¹ØÎĵµ£º

Linux——½¨Á¢½»²æ±àÒë»·¾³£¨gcc£©

windowsÖ÷»úºÍLinuxÐéÄâ»úÉèÖÃÎļþ¼Ð¹²Ïí
µÚÒ»²½£º´ò¿ªÐéÄâ»ú µãvm-----install vmtools
µÚ¶þ²½£º¿ªÊ¼ÐéÄâ»úLinux
ÔÚÖն˼üÈëÒ»ÏÂÃüÁî
cp /mnt/cdrom/VMwareTools-6.0.0-45731.tar.gz /usr/tmp
cd /usr/tmp
tar xzvf VMwareTools-6.0.0-45731.tar.gz
cd vmware-tools-distrib
./vmware-install.pl
һ·»Ø³µ£¬µÈ¿´µ ......

Linux»ñÈ¡±¾»úIP¡¢MACʾÀý³ÌÐò

#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <stdio.h>
#include <string>
#include <iostream>
#include <cstring>
using namespace std;
void peek_interfaces(int ......

linux find ÃüÁîʵÀý

·find  path  -option  [  -print ]  [ -exec  -ok  command ]  {} \;
#-print ½«²éÕÒµ½µÄÎļþÊä³öµ½±ê×¼Êä³ö
#-exec  command  {} \;     -----½«²éµ½µÄÎļþÖ´ÐÐcommand²Ù×÷,{} ºÍ \;Ö®¼äÓпոñ
#-ok ºÍ-execÏàͬ£¬Ö»²»¹ýÔÚ²Ù×÷ǰҪѯ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ