系統架構設計師輔導:處理圖像

    時間:2024-09-30 11:38:40 系統架構師 我要投稿
    • 相關推薦

    系統架構設計師輔導:處理圖像

      如果您的應用程序顯示大量圖像文件(例如,.jpg 和 .gif 文件),則您可以通過以位圖格式預先呈現圖像來顯著改善顯示性能。要使用該技術,請首先從文件中加載圖像,然后使用 PARGB 格式將其呈現為位圖。下面的代碼示例從磁盤中加載文件,然后使用該類將圖像呈現為預乘的、Alpha 混合 RGB 格式。例如:

    系統架構設計師輔導:處理圖像

      [C#]

      if ( image != null && image is Bitmap )

      {

      Bitmap bm = (Bitmap)image;

      Bitmap newImage = new Bitmap( bm.Width, bm.Height,

      System.Drawing.Imaging.PixelFormat.Format32bppPArgb );

      using ( Graphics g = Graphics.FromImage( newImage ) )

      {

      g.DrawImage( bm, new Rectangle( 0,0, bm.Width, bm.Height ) );

      }

      image = newImage;

      }

      [Visual Basic .NET]

      If Not(image Is Nothing) AndAlso (TypeOf image Is Bitmap) Then

      Dim bm As Bitmap = CType(image, Bitmap)

      Dim newImage As New Bitmap(bm.Width, bm.Height, _

      System.Drawing.Imaging.PixelFormat.Format32bppPArgb)

      Using g As Graphics = Graphics.FromImage(newImage)

      g.DrawImage(bm, New Rectangle(0, 0, bm.Width, bm.Height))

      End Using

      image = newImage

      End If

    【系統架構設計師輔導:處理圖像】相關文章:

    系統架構設計師要素01-11

    系統架構設計師考試之路01-11

    系統架構設計師考試報考條件12-30

    系統架構設計師考試報考指南06-19

    系統架構設計師:優化顯示速度01-11

    系統架構設計師:考慮用戶的觀點01-11

    系統架構設計師考試試題舉例10-22

    系統架構設計師:性能調整和診斷01-11

    優秀系統架構設計師需要具備的條件01-02

    91久久大香伊蕉在人线_国产综合色产在线观看_欧美亚洲人成网站在线观看_亚洲第一无码精品立川理惠

      日韩在线一本三区四区 | 日本免费大黄在线观看 | 亚洲国产中文一卡二卡三卡免费 | 在线播放免费人成视频网站 | 亚洲激情小说在线 | 在线波多野结衣绝顶高潮抖动 |