以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 有办法把图片变成满的吗? (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=192621) |
-- 作者:xxfoxtable -- 发布时间:2024/7/6 13:27:00 -- 有办法把图片变成满的吗? 此主题相关图片如下:1.png 设置控件都不好用
|
-- 作者:有点蓝 -- 发布时间:2024/7/6 13:34:00 -- http://www.foxtable.com/webhelp/topics/0813.htm |
-- 作者:xxfoxtable -- 发布时间:2024/7/6 13:37:00 -- 我是这样设置的,不管用 |
-- 作者:有点蓝 -- 发布时间:2024/7/6 13:48:00 -- 我测试没有问题 |
-- 作者:xxfoxtable -- 发布时间:2024/7/6 14:52:00 -- 此主题相关图片如下:1.png 这三个都试了,都不行,normal太大了 Dim zpk1 As WinForm.PictureBox = e.Form.Controls("照片") Dim tbl As WinForm.TabControl = e.Form.Controls("TabControl1") Dim ylk As WinForm.Panel = e.Form.Controls("预览框") Dim zs As WinForm.Button = e.Form.Controls("左上") Dim yx As WinForm.Button = e.Form.Controls("右下") Dim sx As WinForm.Line = e.Form.Controls("上线") Dim zx As WinForm.Line = e.Form.Controls("左线") \'计算截图框坐标 Dim bl_w As Double = 640 / ylk.Width \'比例 Dim bl_h As Double = 480 / ylk.Height ,比例 Dim x As Integer = Math.Abs(zs.Left-ylk.left) * bl_w Dim y As Integer = Math.Abs(zs.Top-ylk.Top) * bl_h Dim w As Integer = sx.Width * bl_w Dim h As Integer = zx.Height * bl_h _Cap.GrapImg() Dim zp As Bitmap zp = Functions.Execute("截图",_Cap.GetBitmap(),x,y,w,h) \'zp = Functions.Execute("截图",_Cap.GetBitmap(),0,0,469,361) zpk1.Image = zp If zpk1.Image IsNot Nothing Then e.Form.Controls("上下翻转").Enabled = True e.Form.Controls("水平翻转").Enabled = True e.Form.Controls("顺转90").Enabled = True e.Form.Controls("逆转90").Enabled = True e.Form.Controls("保存照片").Enabled = True e.Form.Controls("删除照片").Enabled = True e.Form.Controls("文件名").text = "pz" & Format(Date.Now,"yyyyMMddHHmmss") & ".jpg" e.Form.Controls("拍摄时间").text = Date.Now e.Form.Controls("分辨率").text = w & "*" & h End If \'保存为临时文件 Dim Img As Image = zpk1.Image Dim path As String = ProjectPath & "Reports" If FileSys.DirectoryExists(path) = False Then FileSys.CreateDirectory(path) End If Img.save(Path & "\\temp.jpg") \'保存临时图片 \'获取图片信息 Dim ifo As new FileInfo(Path & "\\temp.jpg") If Ifo.Length > 1024*1024 e.Form.Controls("大小").text =Round2(Ifo.Length/(1024*1024),1) & "MB" ElseIf Ifo.Length > 1024 e.Form.Controls("大小").text =Round2(Ifo.Length/1024,1) & "KB" Else e.Form.Controls("大小").text =Ifo.Length & "Btye" End If zpk1.SizeMode = ImageSizeMode.StretchImage 最后加一句也不行 [此贴子已经被作者于2024/7/6 14:55:37编辑过]
|
-- 作者:有点蓝 -- 发布时间:2024/7/6 15:07:00 -- 测试没有问题 不加zpk1.SizeMode = ImageSizeMode.StretchImage效果 使用zpk1.SizeMode = ImageSizeMode.StretchImage后效果
|
-- 作者:xxfoxtable -- 发布时间:2024/7/6 15:12:00 -- 那没办法了,我这里真的不行 |