| 发表于:2008-01-05 10:04:032楼 得分:0 |
这是我写的一个简单屏幕放大程序也许对你有用 dim rtc as rect dim scrnwidth as integer dim scrnhight as integer dim cap as string dim deskdc as long '存储桌面窗口设备句柄 dim imgdc as long 'imagedc dim picdc as long '放大后的dc dim downpos as pointapi 'mousedownpos x,y dim uppos as pointapi 'mouseuppos x,y dim mflag as boolean '初始化 private sub initme() ' cap = caption scrnwidth = screen.width scrnhight = screen.height deskdc = getdc(0) '获取桌面窗口设备场景句柄 imgdc = imgs.hdc end sub private sub form_load() initme end sub private sub form_unload(cancel as integer) releasedc 0, deskdc '释放桌面窗口设备句柄 releasedc 0, imgdc end sub private sub getmousepos_timer() '显示鼠标位置 dim cp as pointapi getcursorpos cp caption = cap & space(10) & cp.x & ", " & cp.y '主要就是下面两句,你要用的bitblt那句,因为你只是抓图..我用的是下面那句.因为我要放大变形... 'bitblt imgdc, 0, 0, 200, 200, deskdc, cp.x - 100, cp.y - 100, srccopy stretchblt imgdc, 0, 0, 400, 400, deskdc, cp.x - 50, cp.y - 50, 100, 100, srccopy end sub | | |
|