VB.NET可以对图片进行熟练的操作。比如对图片进行合并或分开等等。在这里我们会为大家介绍一下有关VB.NET相框效果的实现方法,希望可以帮助大家提高对图片处理方面的认知程度。#t#
创新互联公司专注于宽城网站建设服务及定制,我们拥有丰富的企业做网站经验。 热诚为您提供宽城营销型网站建设,宽城网站制作、宽城网页设计、宽城网站官网定制、小程序定制开发服务,打造宽城网络公司原创品牌,更为您提供宽城网站排名全网营销落地服务。
VB.NET相框效果实现代码示例:
- Dim innerImg As ImageImage = Image.
FromFile(innerImgPath)- Dim outerImg As ImageImage = Image.
FromFile(outerImgPath)- Dim b As New Bitmap(outerImg.Width,
outerImg.Height, PixelFormat.
Format16bppRgb555)- Dim g As GraphicsGraphics =
Graphics.FromImage(b)- g.Clear(Color.White)
- Dim p1(2) As Point
- Dim p2(2) As Point
- If outerImg.Width >= innerImg.Width Then
- If outerImg.Height >= innerImg.Height Then
- p1(0) = New Point((outerImg.Width -
innerImg.Width) \ 2, (outerImg.Height -
innerImg.Height) \ 2)- p1(1) = New Point((outerImg.Width +
innerImg.Width) \ 2, (outerImg.
Height - innerImg.Height) \ 2)- p1(2) = New Point((outerImg.Width -
innerImg.Width) \ 2, (outerImg.Height +
innerImg.Height) \ 2)- Else
- p1(0) = New Point((outerImg.Width -
innerImg.Width) \ 2, 0)- p1(1) = New Point((outerImg.Width +
innerImg.Width) \ 2, 0)- p1(2) = New Point((outerImg.Width -
innerImg.Width) \ 2, outerImg.Height)- End If
- Else
- If outerImg.Height >= innerImg.Height Then
- p1(0) = New Point(0, (outerImg.Height
- innerImg.Height) \ 2)- p1(1) = New Point(outerImg.Width,
(outerImg.Height - innerImg.Height) \ 2)- p1(2) = New Point(0, (outerImg.Height
+ innerImg.Height) \ 2)- Else
- p1(0) = New Point(0, 0)
- p1(1) = New Point(outerImg.Width, 0)
- p1(2) = New Point(0, outerImg.Height)
- End If
- End If
- p2(0) = New Point(0, 0)
- p2(1) = New Point
(outerImg.Width, 0)- p2(2) = New Point
(0, outerImg.Height)- g.DrawImage(innerImg, p1)
- g.DrawImage(outerImg, p2)
- b.Save(mergImgPath)
- outerImg.Dispose()
- innerImg.Dispose()
- Return True
- Catch ex As Exception
- Return False
- End Try
测试VB.NET相框效果代码
- 'Dim innerImgPath As String =
"c:\Winter.jpg"- 'Dim outerImgPath As String =
"c:\17.gif"- 'Dim savePath As String =
"C:\merg.jpg"- 'If ImgMerg.MergedImage
(innerImgPath, outerImgPath,
savePath) = True Then- ' Dim bMerg As New System.
drawing.Bitmap(savePath)- 'Else
- ' MsgBox("错误")
- 'End If
- End Function
- End Class
VB.NET相框效果的相关操作方法就为大家介绍到这里。
新闻名称:VB.NET相框效果具体方式解析
转载源于:http://www.shufengxianlan.com/qtweb/news0/199600.html
网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联