使用Win32 API显示图像 [英] Displaying Images using Win32 API

查看:203
本文介绍了使用Win32 API显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。我是使用Win32 API的初学者。我想知道如何通过使用StretchDIBits()API函数在窗口/对话框中显示大尺寸图像(5MP-2592x1944),而不会影响图像质量。如果我通过使用此功能执行此操作,则图像看起来很嘈杂。有没有人可以指导我这个?

我的功能:

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:

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

推荐答案

使用任何标准插值算法更好地插入图像。



https://en.wikipedia.org/wiki/Image_scaling [ ^ ]
Better to interpolate the image with any standard interpolation algorithms.

https://en.wikipedia.org/wiki/Image_scaling[^]


您可以尝试我的 DLL Plain C Resampling DLL [ ^ ]。
You may try my DLL: "Plain C Resampling DLL"[^].


这篇关于使用Win32 API显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆