604
社区成员
发帖
与我相关
我的任务
分享
Function long GdiplusStartup(ref long token, ref GdiplusStartupInput inputX, long Output) Library "gdiplus.dll"
Function long GdipCreateFromHDC( ulong hdc, ref long graphics) Library "gdiplus.dll"
Function long GdiplusShutdown (ref long token) library "gdiplus.dll" alias for "GdiplusShutdown"
Function long GdipDrawImage(ref long graphics,ref long Image, real ix, real iy) Library "gdiplus.dll" alias for "GdipDrawImage"
Function long GdipLoadImageFromFile(string filename,ref Long Image) library "gdiplus.dll" alias for "GdipLoadImageFromFile"
Function long GdipDisposeImage(long Image) Library "gdiplus.dll"
FUNCTION ulong GetDC(ulong hwnd) LIBRARY "user32.dll"
long ll_Graphics
long Instance
long ll_pic
long ll_dc
blob lb_str
Char ls_str[]
long ll_j
GdiplusStartupInput gsi_data
gsi_data.gdiplusversion = 1
If GdiplusStartup(ref Instance, ref gsi_data, 0) <> 0 Then
messagebox("Error!","Error!")
return
End If
ll_Graphics = 10
ll_dc = GetDC(Handle(this))
If GdipCreateFromHDC(ll_dc, ref ll_Graphics) <> 0 then
messagebox("Error!","Error!")
return
End If
ll_pic = 10
lb_str = ToUnicode("C:\1.png")
for ll_j = 1 to len(lb_str)
ls_str[ll_j] = char(blobmid(lb_str,ll_j,1) )
Next
ll_j = GdipLoadImageFromFile(ls_str, ref ll_pic)//"C:\1.png", ref ll_pic)
MessageBox("", string(ll_j) )
//If GdipLoadImageFromFile("D:\1.png", ref ll_pic) <> 0 then
//
// Messagebox("", "223")
//
// GdiplusShutdown(ref Instance)
//
// Return
//
//End If
ll_j = GdipDrawImage(ref ll_Graphics, ref ll_pic, 0, 0)
If ll_j <> 0 then MessageBox("", string(ll_j) )
GdiplusShutdown(ref Instance)