Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / June 2007

Tip: Looking for answers? Try searching our database.

Save images to memorystream?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stupid48 - 23 Jun 2007 01:58 GMT
I'm writing a simple screen capture program that is using the Bitmap
class to save the capture.  I would like to do multiple captures and
save them as we go along.  I know that I could save them to a
temporary folder on the filesystem but is there a way to save them to
memory (i.e. memorystream) and, if so, how do I reference them later
(C# or VB.Net is fine)?

Thanks, Chris
Hagop Karaguezian - 23 Jun 2007 08:38 GMT
Hello S,
You could use the Bitmap.Save method. The method supports both a filename
parameter and a Stream parameter. Check the overloads to see which one suits
you.
A quick example I just cooked up:
  Bitmap bmp; // this is the captured image
  System.IO.MemoryStream memStream = new MemoryStream();
  bmp.Save( memStream, System.Drawing.Imaging.ImageFormat.MemoryBmp );
You could try other overloads of the Save method to suit your needs. I'm
also not very sure of the second parameter to the Save method; you'll have
to use the format which suits you the most.

> I'm writing a simple screen capture program that is using the Bitmap
> class to save the capture.  I would like to do multiple captures and
[quoted text clipped - 4 lines]
>
> Thanks, Chris

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.