Pixel manipulation in bitmap using MFC
Hi I have created a dialog using the MFC dialog. using below url i displayed bitmap in dialog.
http://www.functionx.com/visualc/applications/displaybitmap.htm
I don't write any code for this. I just added a bitmap image to the image import dialog and used the image control and followed the tutorial ... when I start my application it displays the image ... now I would like to know if it is possible to manipulate pixels using this image .. why i ask it means i am not writing any code to display the image ... pls clarify me in that regard .... thanks a bunch
GetDIBits () and spouses are what you need. Quite frankly, win32 rendering and DC manipulation manipulation is a pretty advanced subject and you will need to do a lot more work than following the tutorial to get it working properly. Start by reading the msdn docs for GetDIBits () and related functions, then read the relevant sections in Petzold, then read all the articles that mention GetDIBits () on codeproject.com. This should teach you enough to do small low-level manipulations.
Alternatively, frame your question better (i.e. explain your problem and what you want to achieve) and maybe get a quick and dirty fix someone can suggest you.
a source to share
I remember Win32 API for loading and decoding bitmaps.
Once you have the bitmap in memory as an RGB buffer, you can modify it. Then you will need to release the modified buffer as a new bitmap which the API API will make for you.
Keep in mind, of course, that having the bitmap in memory, where you would then like to increase the dimensions of the image, will require appropriate buffer manipulation - there is no Win32 API for generalized bitmap editing.