Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.
' Copy the foreground image into a bitmap. Dim phototouse As String phototouse = "C:\inetpub\wwwroot\watermark.png" Dim picForeground As System.Drawing.Bitmap = New System.Drawing.Bitmap(phototouse) Dim fg_wid As Integer = picForeground.Width Dim fg_hgt = picForeground.Height Dim fg_bm As New Bitmap(fg_wid, fg_hgt) Using gr As Graphics = Graphics.FromImage(fg_bm) gr.DrawImage(picForeground, 0, 0, fg_wid, fg_hgt) End Using ' Make the red pixels transparent. fg_bm.MakeTransparent(Color.White) Dim photo As String = photoname ' Make the result bitmap. Dim picBackground As System.Drawing.Bitmap = New System.Drawing.Bitmap(localfolder & photo) Dim bg_wid As Integer = picBackground.Width Dim bg_hgt = picBackground.Height Dim bg_bm As New Bitmap(bg_wid, bg_hgt) If cy = 0 And cx = 0 Then 'Need to position photo in far left corner b/c pattern not found cx = 0 ' Set to zero for logo in left bottom corner, set to bg_wid - 90 for logo in bottom right corner cy = bg_hgt - 20 Else 'pattern found, adjust to cover the pattern cx = cx - 2 cy = cy - 11 End If Using gr As Graphics = Graphics.FromImage(bg_bm) gr.DrawImage(picBackground, 0, 0, bg_wid, bg_hgt) ' Draw the foreground image on top. gr.DrawImage(fg_bm, cx, cy, fg_wid, fg_hgt) End Using ' Display the result. Dim destfile As String = localfolder & photonewname bg_bm.Save(destfile) ' We don't need the foreground bitmap any more. fg_bm.Dispose()
|VB.NET - Extract Pairs out of a string (JSON)||4||33|
|Datagridview control last row back color red vb.net||4||23|
|Help with sending PDF contents to server when Hyperlink Clicked.||5||14|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
11 Experts available now in Live!