I use this function for stamp two image and get result as new image file:
Public Sub CaptureFormAndSaveFile(ByVal masterimagefile As String, ByVal fileforappend As String, ByVal masterimagefileoutput As String, ByVal Left As Long, ByVal Top As Long)
On Error Resume Next
Dim Source As WIA.ImageFile
Set Source = New WIA.ImageFile
Source.LoadFile App.Path & "\" & fileforappend
Dim ImgF As WIA.ImageFile
Dim ImgP As WIA.ImageProcess
Set ImgF = New WIA.ImageFile
ImgF.LoadFile App.Path & "\" & masterimagefile
Set ImgP = New WIA.ImageProcess
With ImgP
.Filters.Add .FilterInfos!Stamp.FilterID
.Filters(1).Properties("ImageFile") = Source
.Filters(1).Properties("Left") = Left
.Filters(1).Properties("Top") = Top
.Filters(1).Properties("FrameIndex") = 0
Set ImgF = .Apply(ImgF)
End With
ImgF.SaveFile App.Path & "\" & masterimagefileoutput
Kill App.Path & "\" & masterimagefile
Kill App.Path & "\" & fileforappend
End Sub
but now i have a picturebox1.image and a png array stream like as b(), now how can stamp that image on b() and get result as new stream?
I found a class named
cGDIPlusCache
and I used is as below to resolve my question: