Do you know how to save a VB Form as JPEG image?

I have a form displaying graph and knob (dial meter) output that is output only. I want to save the form "image" as a JPEG file (or other picture format) so I can display it in a web page for info purposes only. I plan to "refresh/rewrite" the JPEG every minute of so. I have seen software that does this. It is nice for presenting info in the browser (to non wintel machines for example).
Any idea how to do it?
Thanks

Also, if you're using VB.NET, this is pretty easy ... something like this would work:
Private Shared Function BitBlt( _
ByVal hdcDest As IntPtr, _
ByVal nXDest As Integer, _
ByVal nYDest As Integer, _
ByVal nWidth As Integer, _
ByVal nHeight As Integer, _
ByVal hdcSrc As IntPtr, _
ByVal nXSrc As Integer, _
ByVal nYSrc As Integer, _
ByVal dwRop As Integer _
) As Boolean
End Function
Private Shared SRCCOPY As Integer = &HCC0020
Private Sub SaveFormToFile(ByVal sourceForm As Form, ByVal filename As String)
Dim formGraphics As Graphics = sourceForm.CreateGraphics()
Dim
bufferRect = sourceForm.ClientRectangle
Dim buffer As Image = New Bitmap(bufferRect.Width, bufferRect.Height, formGraphics)
Dim bufferGraphics As Graphics = Graphics.FromImage(buffer)
Dim formDC As IntPtr = formGraphics.GetHdc()
Dim bufferDC As IntPtr = bufferGraphics.GetHdc()
BitBlt(bufferDC, 0, 0, bufferRect.Width, bufferRect.Height, formDC, 0, 0, SRCCOPY)
bufferGraphics.ReleaseHdc(bufferDC)
formGraphics.ReleaseHdc(formDC)
bufferGraphics.Dispose()
formGraphics.Dispose()
buffer.Save(filename, System.Drawing.Imaging.ImageFormat.Jpeg)
buffer.Dispose()
End Sub
If you copied and pasted this to your form, you could then save the form to a .jpg file anytime you want by passing the Me reference in for this first parameter and the filename that you want to save it to. For example, if you wanted to create a .jpg file in the root directory of your C drive called "Test.jpg":
SaveFormToFile(Me, "Test.jpg")
- Elton

Similar Messages

  • Do you know how to save Pages file into PDF?

    Using Pages on iPad I'd like to save what I write into PDF file in order to share it with my friends. Unfortunately I don't see how to do that.
    Even when I send this file via email as a PDF again it is not an attachment but it becomes body of the email itself
    Do you heve any suggestion?
    Appreciate any help on this
    Best Regards and Ciao
    Roberto

    Also, if you're using VB.NET, this is pretty easy ... something like this would work:
    Private Shared Function BitBlt( _
    ByVal hdcDest As IntPtr, _
    ByVal nXDest As Integer, _
    ByVal nYDest As Integer, _
    ByVal nWidth As Integer, _
    ByVal nHeight As Integer, _
    ByVal hdcSrc As IntPtr, _
    ByVal nXSrc As Integer, _
    ByVal nYSrc As Integer, _
    ByVal dwRop As Integer _
    ) As Boolean
    End Function
    Private Shared SRCCOPY As Integer = &HCC0020
    Private Sub SaveFormToFile(ByVal sourceForm As Form, ByVal filename As String)
    Dim formGraphics As Graphics = sourceForm.CreateGraphics()
    Dim
    bufferRect = sourceForm.ClientRectangle
    Dim buffer As Image = New Bitmap(bufferRect.Width, bufferRect.Height, formGraphics)
    Dim bufferGraphics As Graphics = Graphics.FromImage(buffer)
    Dim formDC As IntPtr = formGraphics.GetHdc()
    Dim bufferDC As IntPtr = bufferGraphics.GetHdc()
    BitBlt(bufferDC, 0, 0, bufferRect.Width, bufferRect.Height, formDC, 0, 0, SRCCOPY)
    bufferGraphics.ReleaseHdc(bufferDC)
    formGraphics.ReleaseHdc(formDC)
    bufferGraphics.Dispose()
    formGraphics.Dispose()
    buffer.Save(filename, System.Drawing.Imaging.ImageFormat.Jpeg)
    buffer.Dispose()
    End Sub
    If you copied and pasted this to your form, you could then save the form to a .jpg file anytime you want by passing the Me reference in for this first parameter and the filename that you want to save it to. For example, if you wanted to create a .jpg file in the root directory of your C drive called "Test.jpg":
    SaveFormToFile(Me, "Test.jpg")
    - Elton

  • I need to erase the contents of my phone and restore to factory settings. Does anybody know how to save your texts so you don't lose them?  Can I back those up to iCloud?  My phone was very likely hacked (Apple's advice was to call the police!)

    "I need to erase the contents of my phone and restore to factory settings. Does anybody know how to save your texts so you don't lose them?  Can I back those up to iCloud?  My phone was very likely hacked (Apple's advice was to call the police!)"
    That was all I could put in the initial "box."  Then it brought me to this page with instructions on how to write a good sentence.
    Proceeding ...
    After going back and forth between Apple, AT&T and the police (all telling me to go to the other two) I took AT&Ts suggestion and got a new number. One tech warned against doing a backup, especially on my Mac, saying if my phone had been hacked then whatever bug was there would then invade my computer. But nobody knows how to determine if the phone has been hacked or a virus was planted there. Unfortunately I know who would have reason to do such a thing and all I can say is that he is at the top technologically and could easily do it. Almost impossible to prove, however.
    So I need to preserve my text messages and my emails as well. I backed up my photos to that Microsoft product (One-Drive) and it froze (Surprise, Surprise) with four short videos to go, and no way of stopping that (when I tried it crashed repeatedly) so I'm in crisis mode here.
    Help ...
    Running 8.0 on 5S
    Thanks!

    Betty I don't know if you fixed your hacking problem but I feel your pain. I've seen some strange things going on between my iMac and my iPhone and Apple has told me the same thing, call the police which I have done. The hackers have stole 500.00 out of my checking account have access to every internet account I use and no matter how often I change the password their right back on the account. I closed my FB account 3 times only to have someone reopen it. Right now I've got a link in my reading list (Safari) that if I click on it, it allows me to log onto my FB account anonymously.
    I've seen a green folder come out of no where while I was trying to delete my passwords out of keychain when that green folder was put into the key chain I was immediately locked out. I than went into system preferences to try to make changes to my security settings, when I clicked on the icon it wouldn't open. I've seen log files of automator receiving commands and sending out my personal information thats on my computer.
    I have a legitamate program called iExplorer that allows you to look at the contents of your iPhone back ups and saw a transaction someone made at the Apple store for some full length movies, some albums, ibooks and other apps but when I called the iTunes store and they said none of those items were showing up on my account. If their not on my account how can they be on my iPhone 6? One day someone was using my gmail account and unknowingly used google maps to search for an Italian restaurant, than a Mexican restaurant than a coffee shop and their search showed up on my iPhone but I didn't have my gmail account installed on my iPhone 6. Using my computer I logged onto my gmail account and looked at the maps history and sure enough there were the searches when I'd hover my curser over the link it gave me the longitude and latitude of the where the hacker was when he was using google maps. I know whoever reads this thinks Im crazy but I've documented everything and can prove the things that I have mentioned in this post actually happened.
    One day I had my laptop (pc) and my iMac next to each other as I was using both. when I clicked on airport it showed that my laptop and my iMac had made a connection and were actually communicating with each other. I know I didn't do it I don't know how. The iMac was logged into my iCloud account while my laptop wasn't. I have formatted my iPhone at least a dozen times, Apple and an Apple retailer have formatted my hard drive not to mention the numerous times I have formatted it but the hackers keep getting on my devices. Im formatting my lap top at this very second because during the course of the night I left the ethernet cable plugged into it and they locked me out of my c: drive, and configured the system so I can't download any updates from Microsoft, overtime I type in www.microsoft.com it changes to ww38.microsoft.com which takes me to a blank page. I right clicked on the page I was redirected to and read the java script and couldn't believe that someone had actually configured Internet Explorer to redirect me to a blank page when I tried to go to Microsoft. Apples answer to all this is there was nothing wrong with my iPhone or my iMac and if I thought there was a problem to call the police which I have done.
    Theres no doubt the hackers are reading this while I type it or will read it and I simply don't care anymore. I no longer email anyone, don't use my iCloud account and have taken precautions to protect my credit but if I ever find out who has invaded my privacy to this extreme the police are going to want to talk to me because Im going to hurt them like they've never been hurt before

  • Does anyone know how to save a file in CC 10.0 or higher that is viewable in CC 9.2?

    I am trying to make my fiels viewable to someone who has Adobe CC version 9.2, but I have version 10.0. Does anyone know how to save my files so the are readable?

    You will likely get better program help in a program forum
    The Cloud forum is not about using individual programs
    The Cloud forum is about the Cloud as a delivery & install process
    If you will start at the Forums Index https://forums.adobe.com/welcome
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says All communities) to open the drop down list and scroll

  • Does anyone know how to save multiple webpages in safari using automator?

    Does anyone know how to save multiple webpages in safari using automator?

    You will likely get better program help in a program forum
    The Cloud forum is not about using individual programs
    The Cloud forum is about the Cloud as a delivery & install process
    If you will start at the Forums Index https://forums.adobe.com/welcome
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says All communities) to open the drop down list and scroll

  • Do you know how to create an svg file?

    I'm trying to create an svg file of a landscape photo that I took.  I was able to use PE12 to create a turn my photo into black and white, where the buildings and such are black and the sky is white.  At this point, I want to delete the sky portion of the photo and save the buildings portion (only) of the photo as an svg or a jpg file.  I was able to save this as a jpg in PE12, but only with the white background in the file.  I don't know how to save it separately.  If I could save it separately, I would bring it into Elements and save it as a svg file.  Am I going about this correctly?  Any help would be appreciated.  Thanks

    Unless you changed the defaults, when you deleted the white sky you should see a checkerboard pattern (the default that denotes transparency).
    Then when you save that as a png the transparency is preserved.
    To turn the sky black press 'D' to set the default colours. Select the paint bucket and, for your image, tolerance to 100 and just click in the white sky.
    Cheers,
    Neale
    Insanity is hereditary, you get it from your children
    If this post or another user's post resolves the original issue, please mark the posts as correct and/or helpful accordingly. This helps other users with similar trouble get answers to their questions quicker. Thanks.

  • I just want to know how to save some of the music manuscript i have created under songwriting, in to a format that I can email to a non-apple PC so that they can print it for me. How

    I just want to know how to save some of the music manuscript i have created under songwriting, in to a format that I can email to a non-apple PC so that they can print it for me. How would I do that?
    Thank you,
    Peter Michaels.

    And you just like helping people?
      That is just the way this forum works - users get help from other users and learn from others and like to contribute if they see they can help.
    My latest challenge was typing in melodies and chords of songs I'd written on the piano. But using the Musical Typing in register C3 I inserted all the notes by playing on the imac keyboard (and written in the treble clef). The only problem is you cant insert the chords at the same time. Now I have an empty bass clef, which requires chords be inserted in register C2 and I dont know yet how to do that.
    To fill in the chords: Join a melody track and a bass track, like this:
    - Create a new software track and record the chords separately with musical typing.
    - Create a new track and copy your melody loops there (just as backup, if something goes wrong)
    - Do the same with the track containing the chords.
    - Then select all loops in the copies of the melody track  and the copy of the chords track and select from the main menu
           Edit -> Join.
    Now you should have a track that contains the bass as well as the melody and both staffs should be filled in the track editor, so you can print both at the same time.
    However, there will be some notes assigned to the wrong staff - very low melody notes will appear in the bass cleff, very high chord notes will appear in the melody cleff - and I don't see how you could fix that in GB.
    Good luck
    Léonie

  • New help with my mac air and airport extreme time capsule dont know how to save to time capsule and use as a external hd

    new help with my mac air and airport extreme time capsule dont know how to save to time capsule and use as a external hd would like 2 store my home videos and pictures on the time machine (ONLY) as the MAC AIR has storage space limited space please help. THANK YOU.

    See the info here about sharing or using the TC for data.
    Q3 http://pondini.org/TM/Time_Capsule.html
    It is extremely important you realise.. the Time Capsule was never designed for this.
    It is a backup target for Time Machine.. that is the software on the computer that does backups.. it has no direct connection to the Time Capsule.
    It has no ability to back itself up.. unlike all other NAS in the market. It is therefore likely one day you will lose all your files unless you seriously work out how to backup.
    The TC is slow to spin up the hard disk and fast to spin down. iTunes and iPhoto will continually lose connection to their respective libraries.
    iPhoto in particular is easy to corrupt when you move photos over wireless into the library.. once corrupted all is corrupt. A single photo will ruin it all.. so backup is utterly essential.
    Time Machine cannot do backups of network drives. ie the TC. You will need a different backup software like CCC. You will then need another target to backup to..

  • I'm trying to export an ID image as a jpg and don't know how to save it at 1920 x 1080.

    Could use some advice on the following question:
    I'm trying to export an image as a jpg and don't know how to save it at 1920 x 1080.

    Thanks Eugene. I was taking the question literally—the OP wanted to directly save a .jpg at 1920x1080 from ID.
    If the ID document is set up as 1920x1080 pixels you could export as PDF and open into PS at exactly 1920x1080 by setting the res to 72 in the import dialog.
    Of course the converted PDF has no compression applied (at least to native ID objects) and would have some higher quality than an exported High quality JPEG.
    But the OP needs a JPEG and if you want to compare compression artifacts, you would have to save the opened PDF as JPEG, close and reopened. With PDF there is the option of saving the opened PDF with Maximum quality, which is probably better than ID's JPEG export High quality. But If I compare the 2 methods in a layered PS file it's hard to discern a meaningful difference. See Compare.psd in this zip
    http://www.zenodesign.com/forum/ExportTest.zip
    Direct
    PDF to JPEG

  • TS1702 I cannot get the keyboard to come up on the ipad mini when in the citrix receiver.  Has anyone ran into this and do you know how to fix it?

    I cannot get the keyboard to come up on the ipad mini when in the citrix receiver.  Has anyone ran into this and do you know how to fix it?

    I am not familiar with Citrix Reciever but is it possible it is open or being used in another open app?
    Try quitting all apps then try again.
    Quit all apps: Double tap the Home button and swipe the app preview page up for each open app

  • TS4124 Hi, do you know how can I upload inelegible songs from itunes to Icloud. They are songs added from original CDs. Another question would be how can I transfer all the music I have in my Ipod Classic to my Itunes or ICloud as I want to back it up.

    Hi, do you know how can I upload inelegible songs from itunes to Icloud. They are songs added from original CDs. Another question would be how can I transfer all the music I have in my Ipod Classic to my Itunes or ICloud as I want to back it up.

    Depends on why it's ineligible.  If it's under 96 Kpbs, try right-clicking on the file and choosing Create AAC Version.  (If you don't see this option, go to iTunes>Preferences, click "Import Settings..." then choose "Import Using: AAC Encoder" and "Setting: iTunes Plus".)  Then rescan your library to see if this version will add to iTunes Match.  Or, after changing your import setting, just re-import the song to your iTunes library.
    If the song is over 200 MB you would have to reduce it's size to make it eligible.

  • I use the same Apple ID on my iPad mini and my iPhone 5. My iPhone 5 was stolen on may 12, 2013. Do you know how to get it back?

    Dear Apple,
    I use the same Apple ID on my iPad mini and my iPhone 5. My iPhone 5 was stolen on may 12, 2013. Do you know how to get it back?

    Click here for information.
    (83340)

  • My mac mini hard drive is failing. I am no longer under warranty. Do you know how much it cost to have Apple replace the hard drive? or How I can replace it myself?

    MY mac mini hard drive is failing. I am no longer under warranty. Do you know how much it cost to have Apple replace the hard drive? or How I can replace it myself?

    You can do it yourself. I did on my 2009 Mini
    http://www.ifixit.com/Device/Mac_Mini
    Also, this place sells HSDs and has install videos.
    http://eshop.macsales.com/installvideos/

  • HT1918 Do you know how to change your credit card details and Country on Itunes? It wont let me!!! Help!!!

    I am trying to change my credit card details on Itunes as I have moved to NZ and closed down the credit card in Australia. There is $5 left to pay on the card. It will not let me update my address to NZ or put in my new credit card details. HELP!!!!!
    It says I have to provide a credit card in the Australia before I can clear my $5 credit card debt and I have now cancelled my card in Australia and don't have another one!
    Do you know how I can change my address to NZ and then change my billing to my new credit card in NZ and pay the $5 bill.
    Do I have to shut down my account or reapply to Itunes with a new email address and leave this bill outstanding!! Seems crazy........but cant seem to see any other way around it!

    Click here and request assistance.
    (87754)

  • Does any one know how to connect itunes up? when i click on store it always says 'itunes could not connect to the store. Make sure your network connection is active and try again.' if you know how to fix tell me please, please!

    does any one know how to connect itunes up? when i click on store it always says 'itunes could not connect to the store. Make sure your network connection is active and try again.' if you know how to fix tell me please, please! thanx

    Work through all the troubleshooting here: iTunes: Advanced iTunes Store troubleshooting
    B-rock

Maybe you are looking for