Solved

Urgent! Save a bitmap Image from PictureBox as a .bmp file

Posted on 2003-11-09
5
689 Views
Last Modified: 2010-05-01
HI guys,

In my application, there is a provision for user to select bitmap images and show them in picturebox. Now I want to save that image in .bmp file.

I can copy that file from selected location but I want to save that image from PictureBox.

I got one example on using MemoryBitmap. But it stores everything in byte array so for bigger images it is slow and very very resource consuming which affects my application performance.

Please guide me with APIs/special logic/builtin vb functions etc.


Thanks
Anand.
0
Comment
Question by:anand2k
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 3

Assisted Solution

by:monvelasquez
monvelasquez earned 50 total points
ID: 9712469
Use the SavePicture Function

assuming the name of the picture control in Picture1

SavePicture Picture1.Picture, "filename.bmp"

0
 
LVL 1

Author Comment

by:anand2k
ID: 9712577
Hello monvelasquez

Yes, SavePicture is a method to save the picture from pacturebox.

but, i have not explained the question properly. I applogies for that.

I want a logic/API by which i can save the bitmap but i want to keep the header of bitmap apart and actual image in file.

In details - in my app there will be number of images say 10, but i will keep the images in 2 files only.
File 1 wil keep headers appended one after one.
FIle2 will keep actual Image, appended one after other.

I know this is very tedious way to do, but my app required that.

I hope, I have explained neatly now.

Thx
Anand
0
 
LVL 5

Accepted Solution

by:
WorkingJourneyman earned 50 total points
ID: 9714268
1. Save bitmap image to temporary file
2. Open temporary file
3. Read bitmap header and store in file1 (headers)
4. Read bitmap data and store in file2 (images)
5. Close and delete temporary file

The format of a bitmap file is documented here: http://msdn.microsoft.com/library/en-us/gdi/bitmaps_4v1h.asp

It may be helpful to store the offset of a bitmap's image data along with the bitmap header in file1.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9714700
hearing...
0
 
LVL 1

Author Comment

by:anand2k
ID: 9796040
THx guys,

I m sure, I have justified both

Many THx


0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question