views:

614

answers:

2

hi i created a dialogbox using MFC dialog.. using below url i displayed a bitmap picture in a dialog box.

http://www.functionx.com/visualc/applications/displaybitmap.htm

i have not write any code for that.i just added the bitmap Picture into import picture dialog box and used picture control and followed the tutorial... when i run my application it displays image... now i would like to know is it possible to do pixel manipulation using this image... why i ask this means i have not write any code for the display of image... pls clarify me in this regard.... Thanks a bunch

A: 

There is I recall a Win32 API to load and decode bitmaps.

Once you have the bitmap in memory an as RGB buffer, you can modify it. You will then need to emit the modified buffer as a new bitmap, which again the API will do for you.

Be aware of course that having a bitmap in memory where you then wish for example to increase the dimensions of the image will require appropriate buffer manipulation - there is no Win32 API for generalized bitmap editing.

Blank Xavier
+1  A: 

GetDIBits() and consorts is what you're after. Quite frankly, win32 image and DC manipulation is a rather advanced subject and you'll need to put in a lot more work than following a tutorial for getting it right. Start by reading the msdn docs for GetDIBits() and related functions, then read the relevant sections in the Petzold, then read all articles that mention GetDIBits() on codeproject.com. That should teach you enough to do low level bitmap manipulation.

Alternatively, phrase your question better (i.e., explain your problem and what you want to achieve) and maybe there's a quick and dirty fix that someone can offer you.

Roel