PPT放映状态下任意拖动图片模板_第1页
PPT放映状态下任意拖动图片模板_第2页
PPT放映状态下任意拖动图片模板_第3页
PPT放映状态下任意拖动图片模板_第4页
PPT放映状态下任意拖动图片模板_第5页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、放映状态下任意拖动图片模板,在office PPT软件可以用。 但WPS需要WPS Excel中启用“宏”的功能,首先就需要下载一个“wps的vba模块”。下载、解压并安装,方法一 宏,建议将宏的安全级别设置为低。 1新建一个ppt空白文档。 2点击菜单:“工具宏宏”,出现对话框。 3对话框中“宏名”随意写个,比如:move,再点“创建”,就进入代码模式。 4删去所有的代码,把下面的代码全拷贝进去,方法一 宏 (更改图片:双击 -设置自选图片格式-填充)使用方法:放映点击图片-放松鼠标-移动鼠标到目标位置(图片会随动)-点击图片。这样就完成移动,1,2,3,4,Option Explicit

2、Declare Function GetKeyState Lib user32 (ByVal nVirtKey As Long) As Integer Private Declare Function WindowFromPoint Lib user32 (ByVal xPoint As Long, ByVal yPoint As Long) As Long Private Declare Function GetWindowRect Lib user32 (ByVal hwnd As Long, lpRect As RECT) As Long Private Declare Function

3、 GetCursorPos Lib user32 (lpPoint As PointAPI) As Long Private Declare Function SetCursorPos Lib user32 (ByVal x As Long, ByVal y As Long) As Long Public Declare Function MonitorFromPoint Lib user32.dll (ByVal x As Long, ByVal y As Long, ByVal dwFlags As Long) As Long Private Declare Function GetSys

4、temMetrics Lib user32 (ByVal nIndex As Long) As Long Private Const SM_SCREENX = 0 Private Const SM_SCREENY = 1 Private Const sigProc = Drag & Drop Public Const VK_SHIFT = &H10 Public Const VK_CTRL = &H11 Public Const VK_ALT = &H12 Private Type PointAPI x As Long y As Long End Type Public Type RECT L

5、eft As Long Top As Long Right As Long Bottom As Long End Type Public mPoint As PointAPI, dPoint As PointAPI Public ActiveShape As Shape Dim dragMode As Boolean Dim dx As Double, dy As Double Sub DragandDrop(sh As Shape) dragMode = Not dragMode If dragMode Then Drag sh End Sub Private Sub Drag(sh As

6、Shape) Dim i As Integer, sx As Integer, sy As Integer Dim mWnd As Long, WR As RECT dx = GetSystemMetrics(SM_SCREENX): dPoint.x = dx dy = GetSystemMetrics(SM_SCREENY): dPoint.y = dy GetCursorPos mPoint With ActivePresentation.SlideShowWindow mWnd = WindowFromPoint(mPoint.x, mPoint.y) GetWindowRect mW

7、nd, WR sx = WR.Left sy = WR.Top dx = (WR.Right - WR.Left) / ActivePresentation.PageSetup.SlideWidth dy = (WR.Bottom - WR.Top) / ActivePresentation.PageSetup.SlideHeight End With If dx dy Then sx = sx + (dx - dy) * ActivePresentation.PageSetup.SlideWidth / 2 dx = dy End If If dy dx Then sy = sy + (dy - dx) * ActivePresentation.PageSetup.SlideHeight / 2 dy = dx End If While dragMode GetCursorPos mPoint sh.Left = (mPoint.x - sx) / dx - sh.Width / 2 sh.Top = (mPoint.y - sy) / dy - sh.Height / 2 DoEvents i = i + 1: If i 2000 Then

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论