Re: Cutting a BMP file to two BMP file
Here is how I would do it:
#include <atlimage.h>
void SplitImage()
{
CImage Image;
Image.LoadFromResource(AfxGetInstanceHandle(),IDB_BITMAP1);
CImage UpperImage;
UpperImage.Create(Image.GetWidth(),Image.GetHeight()/2,Image.GetBPP());
HDC hdc = UpperImage.GetDC();
Image.BitBlt(hdc,0,0,Image.GetWidth(),Image.GetHeight()/2,0,0);
UpperImage.ReleaseDC();
UpperImage.Save("UpperPart.bmp",Gdiplus::ImageFormatBMP);
CImage LowerImage;
LowerImage.Create(Image.GetWidth(),Image.GetHeight()/2,Image.GetBPP());
hdc = LowerImage.GetDC();
Image.BitBlt(hdc,0,0,Image.GetWidth(),Image.GetHeight()/2,0,Image.GetHeight()/2);
LowerImage.ReleaseDC();
LowerImage.Save("LowerPart.bmp",Gdiplus::ImageFormatBMP);
}
AliR.
"Matrixinline" <anup.kataria@gmail.com> wrote in message
news:298564c7-75d2-46ed-80d9-8bfa40cea879@s28g2000prd.googlegroups.com...
Hi
Can you please let me know how Can I cut a BMP file to 2 Bitmap file.
I do not want to change the widht of file but yes I wish to split the
height.
Do I need to just copy the bits and it will get done?
Thanks
Anup