Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi Guys.I'm a beginner working with Win32 API. i want to know how to display Large size images(5MP-2592x1944) in Window/Dialog by using StretchDIBits() API function without affecting the Quality of image. WHen i do this by using this function the image is appearing to noisy. Could anyone guide me on this?
My function:
C++
case WM_PAINT:
{
	if(g_flag==1)
	{
		UINT Dx=10,Dy=75,DWidth=1024,DHeight=768;
		hdc = BeginPaint(hDlg, &ps);
		HDC Dhdc=GetWindowDC(hDlg);			
		StretchDIBits(Dhdc,Dx,Dy,DWidth,DHeight,0,0,g_Width,g_Height,g_pRGB_Buffer,&g_Bitmapinfo,DIB_RGB_COLORS,SRCCOPY);
		DeleteDC(hdc);
		DeleteDC(Dhdc);				
	}
	// TODO: Add any drawing code here...
	EndPaint(hDlg, &ps);					
}
Posted
Updated 15-May-13 0:32am
v2

Better to interpolate the image with any standard interpolation algorithms.

https://en.wikipedia.org/wiki/Image_scaling[^]
 
Share this answer
 
v2
You may try my DLL: "Plain C Resampling DLL"[^].
 
Share this answer
 
Comments
Balaji_mcr 16-May-13 1:03am    
Thank you @Santhosh G & CPallini for your kind suggestion. i've tried to use SetStretchBltMode(whdc,HALFTONE ); Halftone mode for large size images. i can get improved image quality on this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900