图片复制的问题

wintergoes 2003-07-05 11:58:06
怎么实现把Picturebox中的一部分选中并复制,剪切,粘帖。
...全文
64 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
wintergoes 2003-07-06
  • 打赏
  • 举报
回复
这种方法只能在一个程序里使用,不能将其复制到粘帖板。
wintergoes 2003-07-06
  • 打赏
  • 举报
回复
wintergoes 2003-07-05
  • 打赏
  • 举报
回复
??
csdngoodnight 2003-07-05
  • 打赏
  • 举报
回复
PaintPicture方法
在Form, PictureBox或Printer上绘制图形文件,不支持命名参数
语法
object.PaintPicture picture, x1, y1, width1, height1, x2, y2, width2, height2, opcode

其中Picture是必需的参数,代表要绘制到object上的图形源.x1, y1是必需的单精度值,指定在object上绘制picture的目标坐标(x-轴和y-轴).Width1是可选的单精度值,指示picture的目标宽度.Height1是可选的单精度值,指示picture的目标高度.x2, y2是可选的单精度值,指示 picture 内剪贴区的坐标(x-轴和y-轴).Width2是可选的单精度值,指示picture内剪贴区的源宽度.Height2是可选的单精度值,指示picture 内剪贴区的源高度.Opcode是可选的长型值或仅由位图使用的代码.用来定义在将pictur绘制到object上对picture执行的位操作.
wintergoes 2003-07-05
  • 打赏
  • 举报
回复
还有cutnx-cutny都换成abs(cutnx-cunny)
wintergoes 2003-07-05
  • 打赏
  • 举报
回复
p和p1都是picture控件







Dim cutox As Long
Dim cutoy As Long
Dim cutnx As Long
Dim cutny As Long
Dim CutYn As Boolean





Private Sub Command1_Click()

p1.PaintPicture p.Picture, 0, 0, cutnx - cutox, cutny - cutoy, cutox, cutoy, cutnx - cutox, cutny - cutoy

End Sub

Private Sub Command2_Click()
SavePicture p1.Image, "c:\windows\desktop\dd.bmp"
End Sub

Private Sub p_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
CutYn = True
cutox = X
cutoy = Y
End Sub

Private Sub p_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If CutYn = True Then
s.Left = cutox
s.Top = cutoy
s.Width = X - cutox
s.Height = Y - cutoy
End If
End Sub

Private Sub p_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
cutnx = X
cutny = Y
p1.Width = cutnx - cutox
p1.Height = cutny - cutoy
CutYn = False
End Sub
odusseus 2003-07-05
  • 打赏
  • 举报
回复
能把你找到的方法拿出来看看吗?
wintergoes 2003-07-05
  • 打赏
  • 举报
回复
我已经找到答案了,用paintpicture就行,
谁进来,谁进来我就给谁分!

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧