有没有高手提点提点,或者给个思路。
我想让图片文字的菜单列表前端的图片,绘成文字显示。

解决方案 »

  1.   

    使用API函数。
     [DllImport("user32",EntryPoint="SetMenuItemBitmaps")]   
      private   static   extern   int   SetMenuItemBitmaps   (IntPtr   hMenu,   int   nPosition,   int   wFlags,   IntPtr   hBitmapUnchecked,   IntPtr   hBitmapChecked);    
      Bitmap bitmap = new   Bitmap("c:\\a.ico");   
      int   MF_BYPOSITION   =   0x0400;   
      SetMenuItemBitmaps(menuFile.Handle,0,MF_BYPOSITION,bitmap.GetHbitmap(System.Drawing.Color.White),bitmap.GetHbitmap(System.Drawing.Color.White));  
    重绘菜单
    http://topic.csdn.net/t/20030611/22/1905041.html 
      

  2.   


    //没必要向楼上那么做
    //其实很简单的 Image image = new Bitmap(24, 24);
    Graphics gs = Graphics.FromImage(image);
    gs.DrawString("啊", new Font("宋体", 14f, GraphicsUnit.Pixel), Brushes.Blue, 0f, 4f);
    gs.Dispose();
    this.测试ToolStripMenuItem.Image = image;
      

  3.   

    不了解API,建议还是用Graphics绘吧,虽然麻烦点,但是还是很实用的。