Dim strImageFile As String = txtFile.Text
Dim b As Bitmap = New Bitmap(strImageFile)
Dim w As Integer = b.Width
Dim p As Color
Dim clr As String
Dim sb As New System.Text.StringBuilder
For y As Integer = 0 To b.Height - 1
sb.Append("<tr><td height=""1px"" style=""width:" & w.ToString & "px;background:linear-gradient(to right,")
For x = 0 To b.Width - 1
p = b.GetPixel(x, y)
clr = System.Drawing.ColorTranslator.ToHtml(p)
sb.Append(clr & ",")
Next
sb.Remove(sb.Length - 1, 1)
sb.Append(")""></td></tr>")
Next
Dim StrDiv As String = "<div style=""display:inline-block;vertical-align: Top;margin:5px;padding:2px;"">"
Dim strResult As String = StrDiv & "<table cellpadding=""0"" cellspacing=""0"" width=""100"" Height=""100""><tbody>" & sb.ToString & "</tbody></table></div>"
txtData1.Text = strResult
If txtData1.Text.Contains("#") Then
Status.Text = "Success!"
End If
Comments
0 B
|0 👍
/0 👎
0 B
|👍
/👎