Using vb.net to program and using version 7.4.3.0
Here is my latest attempt and it seems to show some changes in yellow and blue for the new additions. most of the lines are showing a yellow pixelation with alot of the lines even though their isn't a difference between the images. These images are plans for a building so it is typically lines of black and some greyscale.
Code: Select all
Using image1 As New MagickImage(CurrentBitmap)
Using image2 As New MagickImage(PreviousBitmap)
Dim diffImage = New MagickImage()
Dim overlayBytes As Byte()
Dim s As New CompareSettings
s.HighlightColor = MagickColor.FromRgba(0, 0, 255, 180) 'setting Red color to be the Highlighted color
s.LowlightColor = MagickColor.FromRgba(0, 0, 0, 180)
image1.Compare(image2, s, diffImage)
image1.Composite(diffImage, CompositeOperator.Difference)
Dim overlayStream As New MemoryStream()
image1.Write(overlayStream, MagickFormat.Jpeg)
overlayBytes = overlayStream.ToArray()
overlayStream.Close()
Response.Clear()
Response.ClearHeaders()
Response.ClearContent()
Response.Buffer = True
Response.ContentType = "image/jpeg"
If Request.Headers.Item("User-Agent").Contains("Edge") AndAlso IsNothing(Request.Headers.Item("GetContentFeatures.DLNA.ORG")) Then
Dim bTemp As Byte()
Response.BinaryWrite(bTemp) 'Empty output
Response.Flush()
Response.SuppressContent = True
HttpContext.Current.ApplicationInstance.CompleteRequest()
End If
'Normal process:
Response.AddHeader("Content-Disposition", "filename=""" & Session("FileName") & ".jpg""")
Response.AddHeader("Content-Length", overlayBytes.Length)
Response.BinaryWrite(overlayBytes.ToArray())
Response.Flush()
Response.End()
End Using
End Using