下面的步骤是否有错?
我加载的jpg图片显示不出来!Private Sub Form_Load()
Dim GpInput As GdiplusStartupInputGpInput.GdiplusVersion = 1
If GdiplusStartup(token, GpInput) <> 0 Then Unload Me
GdipLoadImageFromFile strptr("c\1.jpg"), ImgGdipGetImageHeight Img, jpgHeight
GdipGetImageWidth Img, jpgWidthGdipCreateFromHDC me.hdc, graphics
Me.ScaleWidth = jpgWidth
Me.ScaleHeight = jpgHeight
GdipDrawImageRect graphics, Img, 0, 0, jpgWidth, jpgHeight
我加载的jpg图片显示不出来!Private Sub Form_Load()
Dim GpInput As GdiplusStartupInputGpInput.GdiplusVersion = 1
If GdiplusStartup(token, GpInput) <> 0 Then Unload Me
GdipLoadImageFromFile strptr("c\1.jpg"), ImgGdipGetImageHeight Img, jpgHeight
GdipGetImageWidth Img, jpgWidthGdipCreateFromHDC me.hdc, graphics
Me.ScaleWidth = jpgWidth
Me.ScaleHeight = jpgHeight
GdipDrawImageRect graphics, Img, 0, 0, jpgWidth, jpgHeight
Dim gdip_pngImage As Long
Dim gdip_Graphics As Long
Dim GpInput As GdiplusStartupInput
GpInput.GdiplusVersion = 1If GdiplusStartup(gdip_Token, GpInput) <> Ok Then
MsgBox "加载GDI+失败!", vbCritical, "加载错误"
End
End If
Picture1.AutoRedraw = True
If GdipCreateFromHDC(Picture1.hDC, gdip_Graphics) <> Ok Then
MsgBox "出现错误!", vbCritical, "错误"
GdiplusShutdown gdip_Token
End
End IfGdipLoadImageFromFile StrConv("d:\p1.jpg", vbUnicode), gdip_pngImage '加载文件
If GdipDrawImage(gdip_Graphics, gdip_pngImage, 0, 0) <> Ok Then Debug.Print "显示失败"
GdipDisposeImage gdip_pngImage
GdipDeleteGraphics gdip_Graphics
GdiplusShutdown gdip_Token