简体   繁体   English

如何使用WIN32核心和VC ++将位图图像拉伸到某些特定的Co Ordinates?

[英]How to stretch a bitmap image to some specific Co Ordinates using WIN32 core and VC++?

I just want to create a program which crops an image and sends the cropped image to some remote location. 我只想创建一个程序来裁剪图像并将裁剪后的图像发送到某个远程位置。

I have loaded the image using BitBlt(). 我已经使用BitBlt()加载了图像。 I dont know, How to uniformly display all the images ? 我不知道,如何统一显示所有图像? all of same size. 都一样大小。 stretching is allowed. 允许拉伸。 I have created a static control and now I want to display all the images inside this static control only... 我已经创建了一个静态控件,现在我只想显示该静态控件中的所有图像...

I am able to display images using STM_SETIMAGE, but the problem is that images are not displayed uniformly. 我可以使用STM_SETIMAGE显示图像,但是问题是图像不能均匀显示。 So I thought to resize the images before sending them to SendMessage(). 所以我想在将图像发送到SendMessage()之前先调整图像的大小。 I have tried BitBlt() and StretchBlt() but I dont know why nothing works in my code. 我已经尝试过BitBlt()和StretchBlt(),但是我不知道为什么在我的代码中什么都不起作用。

The detailed Code 详细代码

Any Help, will be appreciated... 任何帮助将不胜感激...

Thanks in advance, 提前致谢,

You might want to try using StretchBlt() instead of BitBlt(). 您可能想尝试使用StretchBlt()而不是BitBlt()。 It allows you to specify the source and destination rectangles which will crop and stretch the image. 它允许您指定将裁剪和拉伸图像的源矩形和目标矩形。

http://msdn.microsoft.com/en-us/library/dd145120(v=vs.85).aspx http://msdn.microsoft.com/en-us/library/dd145120(v=vs.85).aspx

如果您将图像内部存储为DIB,建议使用StretchDIBits ()。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM