Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7986225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:47:46+00:00 2026-06-04T11:47:46+00:00

i convert a SVG to canvas using canvg to an image and then vb.net

  • 0

i convert a SVG to canvas using canvg to an image and then vb.net client side i convert the image to bytearray() and saved it to a folder on my server so i can attached by email :

 Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
    Dim path = Server.MapPath("PDFs\")
    Dim fileNameWithPath As String = path + DateTime.Now.ToString().Replace("/", "-").Replace(" ", "-").Replace(":", "") + ".jpeg"
    Dim fs As FileStream = New FileStream(fileNameWithPath, FileMode.Create)
    Dim bw As BinaryWriter = New BinaryWriter(fs)
    Dim ByteArray() As Byte = Convert.FromBase64String(hfChartImg.Value)
    bw.Write(ByteArray)
    bw.Close()

    Dim file As String = fileNameWithPath
    Dim message As New MailMessage()
    message.From = New MailAddress("****************")
    message.To.Add(New MailAddress("***************"))
    message.Subject = "new image "
    message.Body = "this is the apak chart img"
    Dim data As New Attachment(file)
    message.Attachments.Add(data)
    Dim client As New SmtpClient()
    client.Host = "smtp.gmail.com"
    client.Credentials = New NetworkCredential("***************", "*******")
    client.EnableSsl = True
    client.Port = 587
    client.Send(message)
End Sub

this code works fine and it send the image .

actually i don’t need to save this image to my server i just wanted to send it without saving , this is what i have done so far

 Protected Sub emailSend_Click(ByVal sender As Object, ByVal e As EventArgs) Handles emailSend.Click
    Dim customerChoice As String = DropDownList1.Text
    Select Case customerChoice
        Case "pdf"
            MsgBox("select pdf ")
        Case "image"
            Dim imageFile As MemoryStream = New MemoryStream()
            Dim bw As BinaryWriter = New BinaryWriter(imageFile)
            Dim bytearray() As Byte = Convert.FromBase64String(hfChartImg.Value)
            bw.Write(bytearray)

am i very far from doing what i want ???

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T11:47:47+00:00Added an answer on June 4, 2026 at 11:47 am

    You’re trying to write

    Dim data As New Attachment(New MemoryStream(ByteArray), "SomeName")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the .NET svg rendering engine to convert an svg file to
I need to run inkscape in PHP so I can convert an svg image
Can I convert SVG image paths to Image map coordinates? Lets assume that I
What would be the most efficient way to convert SVG to PNG, server side?
I'm trying to convert SVG to PNG using Python, Cairo and librsvg. Everything is
i convert an image to base64 string to upload through HttpWebRequest in c#.on server
Is there a way to convert SVG files to HTML5's canvas compatible commands?
Is there any working module to convert a SVG image into a pixel format
I have a website which uses SVG for an interactive client side thingamabob. I
I'm using ImageMagickObject COM+ in Classic ASP. I am trying to convert an SVG-file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.