'Coger la imagen inicial
Dim bitmapImagen As New System.Drawing.Bitmap(Server.MapPath(aspImage.ImageUrl))
'Dibujar puntos
bitmapImagen.SetPixel(10, 10, System.Drawing.Color.Red)
bitmapImagen.SetPixel(12, 14, System.Drawing.Color.Yellow)
bitmapImagen.SetPixel(14, 12, System.Drawing.Color.Orange)
bitmapImagen.SetPixel(5, 5, System.Drawing.Color.Blue)
'Dibujar una línea
Dim grafico As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(bitmapImagen)
grafico.DrawLine(New System.Drawing.Pen(System.Drawing.Color.Red), New System.Drawing.Point(20, 20), New System.Drawing.Point(100, 50))
'Pintar la nueva imagen
Dim memoryStream As New System.IO.MemoryStream()
bitmapImagen.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Png)
Dim datosEnBase64 = Convert.ToBase64String(memoryStream.ToArray())
aspImage.ImageUrl = "data:image/png;base64," + datosEnBase64