0

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);

Edited by __avd: Added [code] tags. Encase your code in: [code] and [/code] tags.

3
Contributors
2
Replies
4
Views
7 Years
Discussion Span
Last Post by Excizted
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.