Hello,

Please help me to resize BMP image to bigger and smaller.

Actually I'm trying to build PC wallpaer image with some function.

And changing wallpaper has no problem but I want to change any image to screen size.

Since desktop screen has some infomation section, bmp image should resized by me.

Kindly see below code and please help me to add resize code .

Thanks a billion.

BITMAP bmpInfo;
	HBITMAP hOldBit;
	HBITMAP  MyBit;

	MyBit = (HBITMAP)LoadImage(NULL, "bgimg.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION | LR_DEFAULTSIZE);

	HDC MemDC =CreateCompatibleDC(pDC);
	hOldBit=(HBITMAP)SelectObject(MemDC,MyBit);
	GetObject(MyBit,sizeof(BITMAP),&bmpInfo);

	BitBlt(tdc,TEXT_ZONE_GAP,TEXT_ZONE_GAP, (nXScreen - TEXT_ZONE_WIDTH_SIZE) - 20, nYScreen - 20, MemDC,0,0,SRCCOPY);
	
	SelectObject(MemDC,hOldBit);

	DeleteDC(MemDC);

Just load it into paint, and use the resize feature.

I can't believe you're asking here, I googled "resize image c++" and had atleast two good results.

http://tinyurl.com/yckgwaf

Have fun.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.