Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to form a Bitmap file?

Posted on 1999-01-14
7
Medium Priority
?
166 Views
Last Modified: 2010-05-03
Currently I have keep all the pixel data in an integer array (gray scale 0 to 255(PGM format)).wondering any one teach me how to create a Bitmap image file with the array?
0
Comment
Question by:nigelcct
[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
  • 4
  • 2
7 Comments
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 200 total points
ID: 1456155
The easiest way is to put it on a picturebox, and use SavePicture to save it to disk. You can also go to www.wotsit.org, and get the BMP file specifications. You can probobly find some source code as well, but it will be for C
0
 
LVL 4

Expert Comment

by:chabaud
ID: 1456156
I have a small sample with pure VB code, if you want...
0
 

Author Comment

by:nigelcct
ID: 1456157
Thank for your help..
   wonder  you know how to form a Bitmap??
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 4

Expert Comment

by:chabaud
ID: 1456158
I'll give you a complete sample if you reject the small MikeP answer. (i mean small for the answer !)
0
 

Author Comment

by:nigelcct
ID: 1456159
Yes please.. Can I have it?? can you email me
nigelcct@singnet.com.sg
Thanks
0
 
LVL 4

Expert Comment

by:chabaud
ID: 1456160
Create a new form with one picturebox and one commandbutton, and test this:

Option Explicit

Private Sub Form_Load()
    Me.ScaleMode = vbPixels
    Picture1.ScaleMode = vbPixels
End Sub

Private Sub Command1_Click()
    Dim c As Long
    Dim i As Integer
    Dim j As Integer
   
    Picture1.Visible = False
   
    For i = 0 To Picture1.Width
        For j = 0 To Picture1.Height
            'for your pb change next line to: c = YourTab(i,j)
            c = Rnd * 256
            Picture1.PSet (i, j), RGB(c, c, c)
        Next
    Next
   
    SavePicture Picture1.Image, "theFile.bmp"
End Sub

0
 
LVL 4

Expert Comment

by:chabaud
ID: 1456161
In the code, your can remove this line to view the picture...
Picture1.Visible = False

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…
Suggested Courses

610 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