合并图片

cxy5636917 2015-01-11 06:18:50
如下图,如何合并两张图为一张图,不需要什么透明度。


合并后,图片1的内容显示在下面,图片2的内容显示在上面。不知道这样说行不?


...全文
247 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
cxy5636917 2015-01-25
  • 打赏
  • 举报
回复
谢谢 zhao4zhong1。我用mask图的方法实现了。
赵4老师 2015-01-19
  • 打赏
  • 举报
回复
[code=vb] PaintPicture 方法 用以在 Form, PictureBox 或 Printer 上绘制图形文件(.bmp、.wmf、.emf、.cur、.ico或 .dib)的内容。不支持命名参数。 语法 object.PaintPicture picture, x1, y1, width1, height1, x2, y2, width2, height2, opcode PaintPicture 方法的语法包含下列部分:
cxy5636917 2015-01-11
  • 打赏
  • 举报
回复
'Option Explicit Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long Private Declare Function TransparentBlt Lib "msimg32.dll" (ByVal hdcDest As Long, ByVal nXOriginDest As Long, ByVal nYOriginDest As Long, ByVal nWidthDest As Long, ByVal nHeightDest As Long, ByVal hdcSrc As Long, ByVal nXOriginSrc As Long, ByVal nYOriginSrc As Long, ByVal nWidthSrc As Long, ByVal nHeightSrc As Long, ByVal crTransparent As Long) As Boolean Private Declare Function GdiTransparentBlt Lib "gdi32" (ByVal hdc1 As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal W1 As Long, ByVal H1 As Long, ByVal Hdc2 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal W2 As Long, ByVal H2 As Long, ByVal Color As Long) As Long Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long Private Sub Command1_Click() GdiTransparentBlt Picture3.hdc, 0, 0, Picture3.ScaleWidth, Picture3.ScaleHeight, Picture1.hdc, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight, Picture1.Point(1, 1) GdiTransparentBlt Picture3.hdc, 0, 0, Picture3.ScaleWidth, Picture3.ScaleHeight, Picture2.hdc, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight, Picture1.Point(1, 1) ' End Sub Private Sub Form_Load() Me.Caption = "读取颜色" Picture1.AutoSize = True Picture1.ScaleMode = 3 Picture2.AutoSize = True Picture2.ScaleMode = 3 Picture3.AutoSize = True Picture3.ScaleMode = 3 Picture2.Width = Picture1.Width Picture2.Height = Picture1.Height Picture3.Width = Picture1.Width Picture3.Height = Picture1.Height End Sub
cxy5636917 2015-01-11
  • 打赏
  • 举报
回复
非白色的部分直接覆盖picture1中位置重合的部分,不重合的picture1中的红色不被覆盖。
cxy5636917 2015-01-11
  • 打赏
  • 举报
回复
看来无解么? 图像处理大师在哪里? 请出来。

809

社区成员

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

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