国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
VB 顯示PNG圖片(適合透明窗體和一般窗體)
[plain] view plain copy
  1. Private Declare Function GdiplusStartup Lib "gdiplus" (token As Long, inputbuf As GdiplusStartupInput, Optional ByVal outputbuf As Long = 0) As GpStatus  
  2. Private Declare Sub GdiplusShutdown Lib "gdiplus" (ByVal token As Long)  
  3.   
  4. Private Declare Function GdipCreateFromHDC Lib "gdiplus" (ByVal hwnd As Long, graphics As Long) As GpStatus  
  5. Private Declare Function GdipDeleteGraphics Lib "gdiplus" (ByVal graphics As Long) As GpStatus  
  6. Private Declare Function GdipDrawImageRect Lib "gdiplus" (ByVal graphics As Long, ByVal image As Long, ByVal x As Single, ByVal y As Single, ByVal Width As Single, ByVal Height As Single) As GpStatus  
  7. Private Declare Function GdipLoadImageFromFile Lib "gdiplus" (ByVal filename As String, image As Long) As GpStatus  
  8. Private Declare Function GdipGetImageWidth Lib "gdiplus" (ByVal image As Long, Width As Long) As GpStatus  
  9. Private Declare Function GdipGetImageHeight Lib "gdiplus" (ByVal image As Long, Height As Long) As GpStatus  
  10. Private Declare Function GdipDisposeImage Lib "gdiplus" (ByVal image As Long) As GpStatus  
  11.   
  12. Private Type GdiplusStartupInput  
  13.     GdiplusVersion As Long  
  14.     DebugEventCallback As Long  
  15.     SuppressBackgroundThread As Long  
  16.     SuppressExternalCodecs As Long  
  17. End Type  
  18.   
  19. Private Enum GpStatus  
  20.     Ok = 0  
  21.     GenericError = 1  
  22.     InvalidParameter = 2  
  23.     OutOfMemory = 3  
  24.     ObjectBusy = 4  
  25.     InsufficientBuffer = 5  
  26.     NotImplemented = 6  
  27.     Win32Error = 7  
  28.     WrongState = 8  
  29.     Aborted = 9  
  30.     FileNotFound = 10  
  31.     ValueOverflow = 11  
  32.     AccessDenied = 12  
  33.     UnknownImageFormat = 13  
  34.     FontFamilyNotFound = 14  
  35.     FontStyleNotFound = 15  
  36.     NotTrueTypeFont = 16  
  37.     UnsupportedGdiplusVersion = 17  
  38.     GdiplusNotInitialized = 18  
  39.     PropertyNotFound = 19  
  40.     PropertyNotSupported = 20  
  41. End Enum  
  42.   
  43.   
  44. '主要代碼就下面這幾句而已.  
  45.   
  46. Private Const c_pngPath As String = "1.png"   '要顯示的圖片名稱(chēng)和路徑。  
  47.   
  48. Dim m_token As Long  
  49.   
  50. Private Sub Form_paint()  
  51.      Dim pImg As Long  
  52.      Dim pGraphics As Long  
  53.      Dim w As Long, h As Long  
  54.       
  55.      Call GdipCreateFromHDC(Me.hDC, pGraphics)  
  56.      Call GdipLoadImageFromFile(StrConv(c_pngPath, vbUnicode), pImg)  
  57.      Call GdipGetImageWidth(pImg, w)  
  58.      Call GdipGetImageHeight(pImg, h)  
  59.      Call GdipDrawImageRect(pGraphics, pImg, 0, 0, w, h)  
  60.       
  61.      Call GdipDisposeImage(pImg)  
  62.      Call GdipDeleteGraphics(pGraphics)  
  63. End Sub  
  64.   
  65. Private Sub Form_Load()  
  66.      Dim StartupInput As GdiplusStartupInput  
  67.      StartupInput.GdiplusVersion = 1  
  68.      If GdiplusStartup(m_token, StartupInput, ByVal 0) Then  
  69.              MsgBox "Error initializing GDI+"  
  70.              Exit Sub  
  71.      End If  
  72. End Sub  
  73.   
  74. Private Sub Form_Unload(Cancel As Integer)  
  75.      Call GdiplusShutdown(m_token)  
  76. End Sub  


本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶(hù)發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
如何屏蔽掉窗體中的關(guān)閉按鈕X?
定制化窗體之閃爍窗體標(biāo)題欄(2)
用VB實(shí)現(xiàn)SmartQQ機(jī)器人
隱藏access窗體背景
VBA 窗體之去除窗體關(guān)閉按鈕
VBA常用代碼解析(第四十一講)
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服