C#ÏÂʵÏÖË«»º³åÃè»¸ßÆµÇúÏß(GDI+½áºÏGDI)
ÓÉÓÚÏîÄ¿ÐèÒª,ҪʹÓÃc#Ãè»¸ßÆµÊµÊ±ÇúÏß.
µ«ÊÇÔÚC#ÏÂÓÉÓÚÃè»Í¼ÏñʹÓõÄÊÇGDI+,Ãè»Ð§ÂʺÜÓÐÎÊÌâ.Ò»µ©ÇúÏßÌ«¶à,¾Í»áÔì³ÉCPUʹÓÃÂÊÖ±ÏßÉÏÉý,ÂíÉÏìÉýµ½100%.
ÔÚGDI+ÏÂʹÓÃË«»º³åÒ²ÎÞ¼ÃÓÚÊÂ,Ë«»º³å±¾ÉíÖ»»á½â¾öÇúÏß¶àµÄʱºòÈ«ÆÁÉÁ˸ÎÊÌâ,µ«Ãè»Ð§ÂÊ»¹ÊÇÑÏÖØµÍÏÂ.
Æä¼äÓùý¶àÖÖ½â¾ö·½°¸:DRECT3D,DRIRECT2D,GDI,,,,,µÈµÈµÈµÈ
×îºó´ÓЧÂʳö·¢,×îÖÕ½â¾ö·½°¸ÈçÏÂ:
ǰ̨ÏÔʾʹÓÃGDI,¶øºǫ́Ãè»Ôò²ÉÓÃGDI+
ºǫ́²ÉÓÃ10±¶ÓÚǰ̨´°¿ÚµÄBUFFER,ÿ´ÎÏòÆäÖлһÌõÏß.È»ºóͨ¹ýÒ»¸öRECTÊÓ¿Ú,ÿ´ÎÏòǰ̨ÏÔʾÊÓ¿ÚÀïµÄÄÚÈÝ.·ñÔòÿ´ÎÖØ»æµÄ´ú¼ÛÌ«¸ß.
Õâ¸ö·½·¨ÊµÏÖµÄÄѵãÖ÷ÒªÔÚÓÚGDIºÍGDI+µÄ½áºÏ²¿·Ö,Ö÷Òª´úÂëÈçÏÂ:
1.º¯Êý¿â:using ºÍ WIN32APIº¯Êý
using System.Runtime.InteropServices;
using System.Drawing;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
using System.Drawing.Text;
[DllImport("gdi32")]
public static extern IntPtr CreateCompatibleDC(IntPtr hdc);
[DllImport("gdi32")]
public static extern IntPtr SelectObject(IntPtr hdc, IntPtr hObject);
[DllImport("GDI32.dll")]
public static extern long BitBlt(IntPtr hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, IntPtr hdcSrc, int nXSrc, int nYSrc, int dwRop);
[DllImport("GDI32.dll")]
public static extern bool DeleteObject(IntPtr hObject);
2.ÉùÃ÷¶ÔÏó
public PictureBox _backgroundGraph;//±»Ã軵Ŀؼþ¶ÔÏó
//public Form _backgroundGraph;
public Graphics _backgroundGraphic = null; // ±³¾°Graphic
public Graphics _backgroundRenderGraphic = null; // Ë«»º³åGraphic
private Graphics _backgroundMemoryGraphic = null; // ÄÚ´æGraphic
public Graphics _backgroundDrawGraphic = null; // Ãè»Graphic
private Bitmap _backgroundMemoryBitmap = null; // ÄÚ´æBitmap
public BufferedGraphics _graphicsBuffer = null; // Ë«»º³åBufferedGraphics
private IntPtr _memoryGraphicHdc; // ÄÚ´æGraphicÊÊÓõÄÒýÓÃ
private IntPtr _memoryBitmapHdc; // ÄÚ´æBitmapÊÊÓõÄÒýÓÃ
3.³õʼ»¯¶ÔÏó
public void InitDraw()
{
_backgroundGraph = pictu
Ïà¹ØÎĵµ£º
ÒÔÏ²ο¼ :http://msdn.microsoft.com/zh-cn/library/87d83y5b.aspx
½Ó¿Ú£¨C# ²Î¿¼£©
¸üУº2007 Äê 11 ÔÂ
½Ó¿ÚÖ»°üº¬·½·¨¡¢ÊôÐÔ¡¢Ê¼þ»òË÷ÒýÆ÷µÄÇ©Ãû¡£³ÉÔ±µÄʵÏÖÊÇÔÚʵÏÖ½Ó¿ÚµÄÀà»ò½á¹¹ÖÐÍê³ÉµÄ£¬ÈçÏÂÃæµÄʾÀýËùʾ£º
ʾÀý
interface ISampleInterface
{
void SampleMethod();
}
class Implem ......
Õâ¸öÎÊÌâÒ²²»ÖªµÀÄѵ¹Á˶àÉÙC#ºÀ½Ü¡£±ÈÆðMFCµÄ½çÃæË¢Ð£¬ÔÚWINFORMÖÐÀ´ÊµÏÖ¶àÏß³ÌË¢ÐÂÕæÊǺÜÍ´¿à£¬¹Êд´ËÎÄ¡£
¶àÏß³ÌˢнçÃæÖ÷ÒªÓõ½¶àỊ̈߳¬Î¯ÍУ¬Ḭ̈߳²È«¡¢Ê¼þµÈһϵÁиßÄѶȵÄC#²Ù×÷¡£
¹ØÓÚίÍкÍʼþ£¬ÕâÓÐһƪºÜÒ×¶®µÄÎÄÕ£ºhi.baidu.com/anglecloudy/blog/item/a52253ee804d052f2df534ab.html
£½£½£½£½£½£½£½£½ ......
ÔÚC#3.0ÖÐÔö¼ÓÁËÒ»¸ö±äÁ¿ÉùÃ÷var£¬Õâ¸öÉùÃ÷ºÍJavaScriptµÄvarÀàËÆ£¬µ°Ò²²»Í¬¡£(*^__^*) ÎûÎû……
1.Ïàͬµã£¬Ëü¿ÉÒÔÓÃvarÀ´ÉùÃ÷ÈκÎÀàÐ͵ľֲ¿±äÁ¿¡£
2.²»Í¬µã Ëü½ö½ö¸æËß±àÒëÆ÷£¬¸Ã±äÁ¿ÐèÒª¸ù¾Ý³õʼ»¯±í´ïʽÀ´È·¶¨±äÁ¿µÄÀàÐÍ£¬¶øÇÒÖ»ÄÜÊǾֲ¿±äÁ¿¡£ ......
±¾ÕÂΪ½Ó¿Ú¿Î³ÌµÄ×ÛºÏÁ·Ï°¡£
±¾´ÎÁ·Ï°Õ¹Ê¾ÁËÒ»¸ö¼ò»¯µÄÒøÐÐÒµÎñÁ÷³Ì£¬ÌåÏÖÁËÒøÐкÍÓû§Êý¸ö½ÇÉ«µÄ¹ØÏµ¡£¿´ÏÂͼ£º
ÕË»§ÀࣨAccount£©¶ÔÏó´æ´¢ÔÚÊý¾Ý¿âÀࣨDatabase£©¶ÔÏóÖУ»¼ÆËã»ú£¨Computer£©Àà¶ÔÏóÁ¬½Óµ½Êý¾Ý¿âÀà¶ÔÏóÉÏ£»ÒøÐйñ̨£¨BankCounter£©Àà¶ÔÏóÓµÓÐһ̨¼ÆËã»ú¶ÔÏó×÷Ϊ˽ÓгÉÔ±£¬ÀûÓøöÔÏó¶ÔÊý¾Ý¿â½øÐвÙ×÷£»AT ......
¡¾ÆªÊ×Óï¡¿Æäʵ±¾ÎĽéÉܵķ½·¨ÊÇÒ»¸ö˼·£¬µ«ÊÇÎҸоõ°ÉÎÊÌâ¸ã¸´ÔÓÁË¡£ÀÏÍâµÄÕâ¸öC#µ÷ÓÃC++µÄdll·½Ê½Í¦ºÃµÄ£¬Ò²ºÜÎȶ¨£¬¿ÉÒÔ¿´¿´http://www.codeproject.com/KB/cs/DynamicInvokeCSharp.aspx¡£
Õª Òª£ºÔÚ¡¶csdn¿ª·¢¸ßÊÖ¡·2004ÄêµÚ03ÆÚÖеġ¶»¯¹¦´ó·¨ ——½«DLLǶÈëEXE¡·Ò»ÎÄ£¬½éÉÜÁËÈçºÎ°ÑÒ»¸ö¶¯Ì¬Á´½Ó¿â×÷Ϊһ¸ ......