汽车在.NET中的图像大小变焦变焦、图像、大小、汽车

2023-09-03 01:07:16 作者:我是我自己的女皇

我在考虑一个个人的学习计划。使用.NET(preferably VB)我想建立一个简单的桌面应用程序,只是功能是显示的漫画,就像CDisplay,但与更先进的导航。我希望能够放大通过单击图像的特定区域,例如个别面板,并有放大区域自动捕捉到面板,并把它吹起来。这些图像通常在诸如将.jpeg,.png,等等。

I'm considering a personal learning project. Using .NET(preferably VB) I want to build a simple desktop app that's only function is to display comics, like CDisplay, but with more advanced navigation. I want to be able zoom in by clicking on certain areas of an image, individual panels for instance, and have the zoom area automatically snap to the panel and blow it up. The images are usually in a standard format like .jpeg, .png, etc..

这样的事情是什么,我要为: http://iphonecomicbookreader.com/

Something like this is what I'm going for: http://iphonecomicbookreader.com/

我甚至不知道这是什么叫?图像映射?色调映射可能?是否有可能在.NET这样做还是会需要某种外界库? code样品将是很好的,但很明显这是pretty的模糊要求。只是被指出了正确的方向将是非常有益的。

I'm not even sure what this is called? Image mapping? Tone mapping maybe? Is it possible to do this within .NET or would it require some kind of outside library? Code samples would be nice, but obviously this is pretty vague request. Just being pointed in the right direction would be really helpful.

感谢

推荐答案

您完全可以在.net中做到这一点。这里是受试者的一个很好的概括:

You can do this entirely in .Net. Here is an excellent overview of the subject:

http://www.$c$cproject.com/KB/books/1861004990.aspx

这是C#,但它确实不难这些东西转化为VB。在这两种语言,它的创建对象和设置属性等方面的问题而已。

It's C#, but it's really not hard to translate this stuff into VB. In both languages, it's just a matter of creating objects and setting properties and so on.

基本上你加载原始图像转换为位图对象(使用内置的方法)。当你想放大的东西,你定义一个Rectangle对象,它描述要缩放,然后用图形的的DrawImage方法要复制的对象并调整该区域进入一个新的位图的区域,然后您再进行然而,显示你喜欢。在code示例说明了如何使用所有这些方法。

Essentially you load the original image into a Bitmap object (using built-in methods). When you want to zoom in on something, you define a Rectangle object that describes the region you want to zoom to, then use the DrawImage method of your Graphics object to copy and resize that region into a new Bitmap, which you then display however you like. The code example shows how to use all of these methods.

的这个唯一的相对困难的部分将是自动确定每个面板的边界。这可能是特别困难的,如果某些面板被不规则形状(像家庭马戏团,好象有人读取),或者如果漫画的扫描未完全对齐。它可能会更好,包括您的应用程序的漫画包含原始图像连同你已经pre定义的描述面板的界限。

The only relatively difficult part of this would be to automatically determine the boundaries of each panel. This could be especially difficult if some of the panels are irregularly shaped (like Family Circus, as if anybody reads that), or if the scan of the comic is not perfectly aligned. It might be better to include comics with your application that contain the original image along with Regions that you've pre-defined that describe the boundaries of the panels.

如果您遇到使用的样本的任何问题,在这里发布一个问题,我(和其他人1000)将很乐意提供帮助。

If you run into any problems using the samples, post another question here and I (and 1000s of others) will be happy to help.

更新:这里有一个示例应用程序我写的节目基本上怎么办这与.net。运行该程序,然后在每一个在动画片的面板,以及每个面板的一个放大的图像将在下面显示。我会后在code为它在第二。

Update: here's a sample app I wrote that shows basically how to do this with .Net. Run the program, then click on each of the panels in the cartoon, and a zoomed-in image of each panel will be displayed below. I'll post the code for it in a second.

更新2 :这里的源$ C ​​$ C

更新3 :这里的漫画原作在上下文中。考虑这是我的致敬的杰夫·阿特伍德。 :)

Update 3: and here's the original comic in context. Consider this my homage to Jeff Atwood. :)