如何在VB中调用.BMP或.JPG的文件

naka 2005-11-07 04:49:00
如何在VB中调用.BMP或.JPG的文件
并对图像进行放大和缩小,画笔的功能呢
...全文
402 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
thirdapple 2005-11-26
  • 打赏
  • 举报
回复
画笔用LineTo比较好
射天狼 2005-11-25
  • 打赏
  • 举报
回复
我的网站上有图像处理的源码,你可以看看。

http://www.j2soft.cn/

VB资料->查询“Vb图像处理的程序”;

====================
免费的学习交流网站,欢迎大家访问!
http://www.j2soft.cn/
http://j2soft.008.net/
zou19820704 2005-11-25
  • 打赏
  • 举报
回复
显示的图象正好和你的picbox大小合适的话就用

Picture1.Picture = loadpicture("c:\test.jpg")
Picture1.PaintPicture Picture1.Picture ,0, 0,Picture1.Width,Picture1.Height
脆皮大雪糕 2005-11-25
  • 打赏
  • 举报
回复
一句式装入图像并缩放
Picture1.PaintPicture LoadPicture("c:\test.jpg"), 0, 0,Picture1.Width,Picture1.Height
Featured 2005-11-24
  • 打赏
  • 举报
回复
加载图片:LoadPicture
缩放:StretchBlt
射天狼 2005-11-12
  • 打赏
  • 举报
回复
我的网站上有源码:

http://j2soft.008.net/

VB资料->查询“显示多个图片”。
上官云峰 2005-11-07
  • 打赏
  • 举报
回复
加载图片
PICTURE1.PICTURE=LOADPICTURE("d:\你好.BMP")

图片放大程序
窗体上控件
HScroll1,HScroll5;Picture1,Picture5,PictureZoom;VScroll1;text1

代码
Private Sub Form_Load()
PictureZoom.Picture = Picture1.Picture
PictureZoom.Width = Picture1.Width
PictureZoom.Height = Picture1.Height
HScroll5.Value = 4
HScroll5_Change
End Sub
Private Sub HScroll1_Change()
PictureZoom.Left = -HScroll1
End Sub
Private Sub HScroll1_Scroll()
PictureZoom.Left = -HScroll1
End Sub
Private Sub HScroll5_Change()
PictureZoom.Cls
PictureZoom.Width = (Picture1.Width * HScroll5.Value / 4) + 25
PictureZoom.Height = (Picture1.Height * HScroll5.Value / 4) + 25
PictureZoom.PaintPicture Picture1.Picture, 0, 0, Picture1.Width * HScroll5.Value / 4, Picture1.Height * HScroll5.Value / 4, 0, 0, Picture1.Width, Picture1.Height
HScroll1.Max = PictureZoom.Width - Picture5.Width
VScroll1.Max = PictureZoom.Height - Picture5.Height

Call AdjustTopLeft
Text1.Text = "Zoom " & HScroll5.Value / 4 * 100 & "%"
End Sub
Private Sub VScroll1_Change()
PictureZoom.Top = -VScroll1
End Sub
Private Sub VScroll1_Scroll()
PictureZoom.Top = -VScroll1
End Sub
Private Sub AdjustTopLeft()
If PictureZoom.Width < Picture5.Width Then
PictureZoom.Left = (Picture5.Width - PictureZoom.Width) / 2
HScroll1.Visible = False
Else
PictureZoom.Left = 0
HScroll1.Visible = True
End If
If PictureZoom.Height < Picture5.Height Then
PictureZoom.Top = (Picture5.Height - PictureZoom.Height) / 2
VScroll1.Visible = False
Else
PictureZoom.Top = 0
VScroll1.Visible = True
End If
End Sub
northwolves 2005-11-07
  • 打赏
  • 举报
回复
use picturebox

放大和缩小:
picture1.PaintPicture
画笔功能:
autoredraw
drawmode
Summer006 2005-11-07
  • 打赏
  • 举报
回复
用picturebox控件比较容易实现。
设置控件scalemode为pixel,autosize为auto,autoredraw为true
用loadpicture 方法载入图片,
width和height属性值为图像的宽高
用point获取点的颜色,
用pset设置点的颜色。
naka 2005-11-07
  • 打赏
  • 举报
回复
请大虾们不涩赐教
熊孩子开学喽 2005-11-07
  • 打赏
  • 举报
回复
加载图片用LOADPICTURE语句:
PICTURE1.PICTURE=LOADPICTURE("c:\123.BMP")

放大缩小用PAINTPICTURE方法:
Picture1.paintpicture(picture2.picture,10,10,200,200)

画点用PSET,
画线用LINE

楼主,您还是先看看书再来问吧

809

社区成员

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

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