1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Using Win32 API SDK

Discussion in 'Software Development' started by celia53, Jan 19, 2003.

Thread Status:
Not open for further replies.
  1. celia53

    celia53 Thread Starter

    Joined:
    Jul 28, 2002
    Messages:
    48
    I am developing a real time application by which I can get in a stream of live images from a camera onto my PC and process them. The camera is analog, a video frame grabber captures the frames. A windows API comes with the frame grabber. It allows graphical display of the 640X480 pixel images and I can save the images each time as a bmp file and feed them to my image processing code.
    To achieve a real time application I need to, instead of saving as bmp files each time, directly grab data from the frame grabber and feed them live to the processing code. The frame grabber comes with a SDK as well. It is programmed in WIN 32. The files are in C and can be compiled from Visual C++ 6.0
    Now my problem is that I have no clue how to access the data values before they are graphically displayed. So my questions are:
    1) Does Win32 allow such an access?
    2) Win32 is event driven and is lot different from C, say. Is there some good reference for me to get a quick understanding of win32?
    3) Can I do away with the graphical display? i.e. withour the .rc files? is this the console application that win32 has?

    Thanks for listening. I checked the forum for similar questions but seems this is a new field to explore. So thanks to all those who can help with their insights or suggestions!
     
  2. celia53

    celia53 Thread Starter

    Joined:
    Jul 28, 2002
    Messages:
    48
    I have made some progress since last time and thought it best to get back to the forum for help.

    I have checked the relevant code in the imaging API's SDK I am using and it's something like this:

    SetDIBitsToDevice( hdc, 0, 0, MYBoard.ScaledSize.x, MYBoard.ScaledSize.y, 0, 0, 0,MYBoard.ScaledSize.y, MYBoard.pBuffer,(LPBITMAPINFO)MYBoard.pBitmapInfoHeader, DIB_RGB_COLORS);

    pbuffer is defined as void * pointer for the struct MyBoard.

    I think MyBoard.pbuffer points to the pixel values for an entire frame i.e. 640*480 pixels. Now it will be valuable if I look into the following:
    1) How do I create a 640*480 matrix from here?
    I have a code which needs this 640*480 matrix as input for image processing. So do I need to do an _asm coding for this? I am using a Visual C++ compiler on a Windows NT machine.
    2) Is it possible to read the memory location in C? i.e can I print out the values pointed by MyBoard.pbuffer? Maybe in a message box in Win32 programming?
    I wrote this line immediately after where SetDIBitsToDevice (I mentioned above) is called
    MessageBox(hwnd, MyBoard.pBuffer, "values", MB_OK);
    But I get ASCII junk letters on compiling.

    Do you have any clues here?
    Thanks in advance for your suggestions and help!
    -Celia
     
  3. Rollin' Rog

    Rollin' Rog

    Joined:
    Dec 9, 2000
    Messages:
    45,855
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - Using Win32
  1. adhya.arya
    Replies:
    2
    Views:
    487
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/114191

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice