CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 1999
    G day Mayt Land

    Wink reading a bmp file

    pset and point(x,y) in olden day basic used to put a pixel and read the color of a pixel ...

    I m trying to do this in VB cos i believe its easier and there must eb an easier way to do it rather than MFC.

    how do you read a BMP file
    or rather

    display it at top left hand corner or (0,0) and read its pixels


  2. #2
    Join Date
    Dec 2003
    Northern Ireland

    Re: reading a bmp file

    That depends on the type of bmp file you are reading.... firstly, you need to retrieve the header info;

    In the header info, you have things like the height and width of the image, the bit depth (eg 8, 16, 24 bit).

    These links may help:



    http://www.cs.uvm.edu/~erickson/educ...b_bmp/BMP.html <-- Create an image in vb)

  3. #3
    Join Date
    Dec 2001

    Re: reading a bmp file

    If the image is to be displayed before reading the pixel values, then you don't need to get the file header. This will also work for gif, jpeg, etc. The fastest way to do this is to use the GetPixel API call. A simple loop can iterate through the image.
    Please remember to rate the posts and threads that you find useful.
    How can something be both new and improved at the same time?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.