Dear Friends,
I am doing a project - in which i have an array of points world coordinates. Using that I Draw the image using SetPixel(). After that using rectangle tool in the menu, User select on the image to get the coordinates, on which the measurement should take place
The problem is now I wanna increase the image size ,like increasing the individual pixel size or increasing the scaling factor in a Graph.
For your kind view, I attach the project here.(visual c++ 6.0)
Note: using SetPixel is generally not a good idea because it's pretty slow. It's much beter to work directly into the memory buffer for the image. You can get the pixel array from an existing bitmap with GetDIBits or you can create your bitmap withCreateDIBSection which returns the HBITMAP and a pointer to the pixel buffer which you can manipulate.
1. If we zoom the object, will the coordinates changes accordingly to the
window or what?- Hope my question is clear (so that I can get the
same coordinates as in original size when its in enlarged mode)
2. I tried to use CreateDIBSection()... which has lot and lot of parameters
which I dont know how to pass... For Setpixel() I just pass the window
coordinates and the color.
Is that, for zooming a painted operation should be a bitmap? because my application is small paint operation.
When you use CreateDIBSection you'll get a pixel buffer. You can then simply write pixel data into that buffer. For example: if your pixel buffer is called pBuff, you can do the following:
Code:
pBuff[0] = 255;
pBuff[1] = 0;
pBuff[2] = 0;
Which will set the first pixel to blue. Remember that bitmap buffers in windows are BGR(A) and not RGB(A).
Once you've done that, you can use StretchDIBits to blit and stretch your image.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.