跟踪栏以增加listview中图像的大小 [英] Track bar to increase the size of image in listview

查看:81
本文介绍了跟踪栏以增加listview中图像的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi


我正在使用带有图像的listview来显示图像,现在我想使用trackbar来增加或减少listview中图像的大小,



hi
I am using listview with images to display images, now i want to trackbar to increase or reduce the size of images in listview,

private void trackBar1_Scroll(object sender, EventArgs e)
      {
          setZoom();
      }

      private void setZoom()
      {
          int newZoom = zoomFactor[zoomBar.Value];
          imageList1.ImageSize = new System.Drawing.Size(newZoom, newZoom);

          listView1.LargeImageList = imageList1;



}



im使用此增加图像的大小

它的工作但缩略图得到改变。


}

i m using this for increasing the size of image
its work but the thumbnail get changes.

推荐答案

你可以有一个足够大的图像(以像素为单位)并将其缩小到所需的大小。这不是一个简单的程序,称为重新采样



这是如何做的秘诀:

http://stackoverflow.com/questions/249587/high-quality-image- scale-c-sharp [ ^ ]。



一般情况下,如果缩小图像,而不是向上,可以重新对图像进行重新采样。我建议你避免扩大它的可能性;或允许一些重新采样,不是很温和,否则它看起来真的很难看。



-SA
You can have an image which is big enough (in pixels) and scale it down to required size. This is not a trivial procedure called re-sampling.

This is the recipe on how to do it:
http://stackoverflow.com/questions/249587/high-quality-image-scaling-c-sharp[^].

Generally, you can re-sample the image with decent quality if you scale it down, not up. I would recommend you to avoid the possibility of scaling it up; or allow some re-sampling up, not very moderate, otherwise it will look really ugly.

—SA


你能帮我写一下函数zoomFactor吗?
Can you help me write the function zoomFactor?


这篇关于跟踪栏以增加listview中图像的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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