网页资讯视频图片知道文库贴吧地图采购
进入贴吧全吧搜索

 
 
 
日一二三四五六
       
       
       
       
       
       

签到排名:今日本吧第个签到,

本吧因你更精彩,明天继续来努力!

本吧签到人数:0

一键签到
成为超级会员,使用一键签到
一键签到
本月漏签0次!
0
成为超级会员,赠送8张补签卡
如何使用?
点击日历上漏签日期,即可进行补签。
连续签到:天  累计签到:天
0
超级会员单次开通12个月以上,赠送连续签到卡3张
使用连续签到卡
05月19日漏签0天
vb吧 关注:156,149贴子:1,166,095
  • 看贴

  • 图片

  • 吧主推荐

  • 游戏

  • 2回复贴,共1页
<<返回vb吧
>0< 加载中...

求助 关于图片缩放

  • 只看楼主
  • 收藏

  • 回复
  • 鹰眼爱徒斗鸡眼
  • 啥也不懂
    1
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
Private Sub Command1_Click()
Picture1.Width = Picture1.Width * 1.2
Picture1.Height = Picture1.Height * 1.2
End Sub
Private Sub Command10_Click()
Dim p()
ScaleMode = 3
Picture1.AutoRedraw = True
Picture1.ScaleMode = 3
w = Picture1.ScaleWidth
h = Picture1.ScaleHeight
ReDim p(w - 1, h - 1)
For i = 0 To w - 1
For j = 0 To h - 1
 p(i, j) = Picture1.Point(i, j)
Next j
Next i
For i = 0 To w - 1
For j = 0 To h - 1
 Picture1.PSet (i, j), p(w - i - 1, h - j - 1)
Next j
Next i
End Sub
Private Sub Command2_Click()
Picture1.Width = Picture1.Width / 1.2
Picture1.Height = Picture1.Height / 1.2
End Sub
Private Sub Command3_Click()
Dim p()
ScaleMode = 3
Picture1.AutoRedraw = True
Picture1.ScaleMode = 3
w = Picture1.ScaleWidth
h = Picture1.ScaleHeight
ReDim p(w - 1, h - 1)
For i = 0 To w - 1
For j = 0 To h - 1
 p(i, j) = Picture1.Point(i, j)
Next j
Next i
Picture1.Width = h + 4 * Picture1.BorderStyle
Picture1.Height = w + 4 * Picture1.BorderStyle
For i = 0 To h - 1
For j = 0 To w - 1
 Picture1.PSet (i, w - j - 1), p(j, i)
Next j
Next i
End Sub
Private Sub Command9_Click()
Dim p()
ScaleMode = 3
Picture1.AutoRedraw = True
Picture1.ScaleMode = 3
w = Picture1.ScaleWidth
h = Picture1.ScaleHeight
ReDim p(w - 1, h - 1)
For i = 0 To w - 1
For j = 0 To h - 1
 p(i, j) = Picture1.Point(i, j)
Next j
Next i
Picture1.Width = h + 4 * Picture1.BorderStyle
Picture1.Height = w + 4 * Picture1.BorderStyle
For i = 0 To h - 1
For j = 0 To w - 1
 Picture1.PSet (h - i - 1, j), p(j, i)
Next j
Next i
End Sub
Private Sub Dir1_Change() '目录change事件
File1.Path = Dir1.Path '目录发生更改时,做出文件路径更改的响应
End Sub
Private Sub Drive1_Change() '驱动器change事件
Dir1.Path = Drive1.Drive '当驱动器发生改变时,做出响应
ChDrive Drive1.Drive
End Sub
Private Sub file1_Click()
Picture1.Picture = LoadPicture(File1.Path + "\" + File1.FileName) '单击文件名时,显示图像
End Sub
我用这个做出来的图片为什么图片缩放不成功呢  老是框在变化,图片不变



  • 光羽ζ待
  • 啥也不懂
    1
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
``直接用 api函数 bitblt 或者 Picture 一个类似的方法 很简单就可以到达效果·· 
 2句话。


2025-05-19 00:23:39
广告
  • 光羽ζ待
  • 啥也不懂
    1
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
例如 放大:
Picture1.Width = Picture1.Width * 1.2 
Picture1.Height = Picture1.Height * 1.2 
Picture1.PaintPicture Picture1, 0, 0, Picture1.Width *1.2, Picture1.Height * 1.2, 0, 0, Picture1.Width, Picture1.Height
缩小 就反过来
Picture1.PaintPicture Picture1, 0, 0, Picture1.Width / 1.2, Picture1.Height / 1.2, 0, 0, Picture1.Width, Picture1.Height
Picture1.Width = Picture1.Width / 1.2 
Picture1.Height = Picture1.Height / 1.2


登录百度账号

扫二维码下载贴吧客户端

下载贴吧APP
看高清直播、视频!
  • 贴吧页面意见反馈
  • 违规贴吧举报反馈通道
  • 贴吧违规信息处理公示
  • 2回复贴,共1页
<<返回vb吧
分享到:
©2025 Baidu贴吧协议|隐私政策|吧主制度|意见反馈|网络谣言警示