15 个解决方案
#1
简单的说就是想把2张照片合成为一张,现在碰到的问题是如何把一张照片合成到一个圆形的图片上。
#2
不知道,帮顶.
#3
不知道,留个脚印
#4
JavaScript 不能做到
要做只能用组件
vb vc都可以
要做只能用组件
vb vc都可以
#5
不知道圆形的图片是什么意思,好像图片都有长和宽的.不过不管怎样javascript也不能把两张合成一张
#6
JS是不能合成一起的, 但GIF叠加方式,让两张叠在一起,看起来就像一幅了,像一些虚拟头像一样,不知你想怎样?
#7
如果只是单纯的将两张图片重叠在一起,可以设置一个div,然后在里面用absolute定位图片位置
#8
用css来控制
<div >
<img alt="Replacement for JVC GZ-MG36EK / GR-DV, GR-DVJ Series Camcorder Battery" src="http://202.134.103.120/uk_ebay_images/VJV005.jpg" width="233" >
</div>
<div style="margin:-80px 0 0 200px"><img src="images/star.gif"></div>
关键在于第二个div的style="margin:-80px 0 0 200px",用来控制偏移的数值
<div >
<img alt="Replacement for JVC GZ-MG36EK / GR-DV, GR-DVJ Series Camcorder Battery" src="http://202.134.103.120/uk_ebay_images/VJV005.jpg" width="233" >
</div>
<div style="margin:-80px 0 0 200px"><img src="images/star.gif"></div>
关键在于第二个div的style="margin:-80px 0 0 200px",用来控制偏移的数值
#9
同意wayne23(人生如梦,一樽还酹江月)的说法
edwardrong(明年-今日) 也是这个意思
但为什么不把两张图片作成一张呢?
edwardrong(明年-今日) 也是这个意思
但为什么不把两张图片作成一张呢?
#10
我是想把“一张照片”作为水印添加到“一个圆形的图片”上
#11
用C#来搞
#12
楼上的能不能提供一个例子阿?没方向阿现在:(
#13
看下ASPJPEG的文档,里面有说明.
#14
Vb.Net实现图片合并(相框效果)Imports System.Drawing
Imports System.Drawing.Imaging
Imports System.Drawing.Drawing2D
Public Class ImgMerg
Public Shared Function MergedImage(ByVal innerImgPath As String, ByVal outerImgPath As String, ByVal mergImgPath As String) As Boolean
Try
Dim fi As System.IO.FileInfo = New System.IO.FileInfo(mergImgPath)
If fi.Directory.Exists = False Then
fi.Directory.Create()
End If
Dim innerImg As Image = Image.FromFile(innerImgPath)
Dim outerImg As Image = Image.FromFile(outerImgPath)
Dim b As New Bitmap(outerImg.Width, outerImg.Height, PixelFormat.Format16bppRgb555)
Dim g As Graphics = 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
'测试代码
'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
Imports System.Drawing.Imaging
Imports System.Drawing.Drawing2D
Public Class ImgMerg
Public Shared Function MergedImage(ByVal innerImgPath As String, ByVal outerImgPath As String, ByVal mergImgPath As String) As Boolean
Try
Dim fi As System.IO.FileInfo = New System.IO.FileInfo(mergImgPath)
If fi.Directory.Exists = False Then
fi.Directory.Create()
End If
Dim innerImg As Image = Image.FromFile(innerImgPath)
Dim outerImg As Image = Image.FromFile(outerImgPath)
Dim b As New Bitmap(outerImg.Width, outerImg.Height, PixelFormat.Format16bppRgb555)
Dim g As Graphics = 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
'测试代码
'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
#15
以上是我做相框效果的代码。
http://www.cnblogs.com/guodaxia/archive/2006/06/08/420867.html
http://www.cnblogs.com/guodaxia/archive/2006/06/08/420867.html
#1
简单的说就是想把2张照片合成为一张,现在碰到的问题是如何把一张照片合成到一个圆形的图片上。
#2
不知道,帮顶.
#3
不知道,留个脚印
#4
JavaScript 不能做到
要做只能用组件
vb vc都可以
要做只能用组件
vb vc都可以
#5
不知道圆形的图片是什么意思,好像图片都有长和宽的.不过不管怎样javascript也不能把两张合成一张
#6
JS是不能合成一起的, 但GIF叠加方式,让两张叠在一起,看起来就像一幅了,像一些虚拟头像一样,不知你想怎样?
#7
如果只是单纯的将两张图片重叠在一起,可以设置一个div,然后在里面用absolute定位图片位置
#8
用css来控制
<div >
<img alt="Replacement for JVC GZ-MG36EK / GR-DV, GR-DVJ Series Camcorder Battery" src="http://202.134.103.120/uk_ebay_images/VJV005.jpg" width="233" >
</div>
<div style="margin:-80px 0 0 200px"><img src="images/star.gif"></div>
关键在于第二个div的style="margin:-80px 0 0 200px",用来控制偏移的数值
<div >
<img alt="Replacement for JVC GZ-MG36EK / GR-DV, GR-DVJ Series Camcorder Battery" src="http://202.134.103.120/uk_ebay_images/VJV005.jpg" width="233" >
</div>
<div style="margin:-80px 0 0 200px"><img src="images/star.gif"></div>
关键在于第二个div的style="margin:-80px 0 0 200px",用来控制偏移的数值
#9
同意wayne23(人生如梦,一樽还酹江月)的说法
edwardrong(明年-今日) 也是这个意思
但为什么不把两张图片作成一张呢?
edwardrong(明年-今日) 也是这个意思
但为什么不把两张图片作成一张呢?
#10
我是想把“一张照片”作为水印添加到“一个圆形的图片”上
#11
用C#来搞
#12
楼上的能不能提供一个例子阿?没方向阿现在:(
#13
看下ASPJPEG的文档,里面有说明.
#14
Vb.Net实现图片合并(相框效果)Imports System.Drawing
Imports System.Drawing.Imaging
Imports System.Drawing.Drawing2D
Public Class ImgMerg
Public Shared Function MergedImage(ByVal innerImgPath As String, ByVal outerImgPath As String, ByVal mergImgPath As String) As Boolean
Try
Dim fi As System.IO.FileInfo = New System.IO.FileInfo(mergImgPath)
If fi.Directory.Exists = False Then
fi.Directory.Create()
End If
Dim innerImg As Image = Image.FromFile(innerImgPath)
Dim outerImg As Image = Image.FromFile(outerImgPath)
Dim b As New Bitmap(outerImg.Width, outerImg.Height, PixelFormat.Format16bppRgb555)
Dim g As Graphics = 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
'测试代码
'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
Imports System.Drawing.Imaging
Imports System.Drawing.Drawing2D
Public Class ImgMerg
Public Shared Function MergedImage(ByVal innerImgPath As String, ByVal outerImgPath As String, ByVal mergImgPath As String) As Boolean
Try
Dim fi As System.IO.FileInfo = New System.IO.FileInfo(mergImgPath)
If fi.Directory.Exists = False Then
fi.Directory.Create()
End If
Dim innerImg As Image = Image.FromFile(innerImgPath)
Dim outerImg As Image = Image.FromFile(outerImgPath)
Dim b As New Bitmap(outerImg.Width, outerImg.Height, PixelFormat.Format16bppRgb555)
Dim g As Graphics = 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
'测试代码
'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
#15
以上是我做相框效果的代码。
http://www.cnblogs.com/guodaxia/archive/2006/06/08/420867.html
http://www.cnblogs.com/guodaxia/archive/2006/06/08/420867.html