您的位置:程序门 -> .net技术 -> c#



[c# winform]小窗口,大图片?


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


[c# winform]小窗口,大图片?[已结贴,结贴人:277894613]
发表于:2007-09-22 17:48:50 楼主
有这么一个应用:在一个比较小的窗口显示一个比较大的图片,怎么自动弄出来一个滚动条阿?大家谁有思路?
谢谢!

图片是显示在picturebox中的
发表于:2007-09-22 18:37:211楼 得分:10
autosize   the   picturebox   is   sized   equal   to   the   size   of   the   image   that   it   contains.    
  centerimage   the   image   is   displayed   in   the   center   if   the   picturebox   is   larger   than   the   image.   if   the   image   is   larger   than   the   picturebox,   the   picture   is   placed   in   the   center   of   the   picturebox   and   the   outside   edges   are   clipped.    
  normal   the   image   is   placed   in   the   upper-left   corner   of   the   picturebox.   the   image   is   clipped   if   it   is   larger   than   the   picturebox   it   is   contained   in.    
  stretchimage   the   image   within   the   picturebox   is   stretched   or   shrunk   to   fit   the   size   of   the   picturebox.    
  zoom   the   size   of   the   image   is   increased   or   decreased   maintaining   the   size   ratio.    


sizemode   这些属性都吧能满足你的要求,因此你需要重写一个自己的控件   去实现你的功能
发表于:2007-09-22 19:42:322楼 得分:8
将一个picturebox放在一个panel控件中,picturebox的大小设成与图象大小一样就行了
发表于:2007-09-23 10:50:533楼 得分:2
picturebox控件,acdsee控件,图片控件;
用c#开发的图片控件,功能类似acdsee;
支持各种图片的浏览,放大,缩小,平移等功能;
源代码参考:http://shop.paipai.com/359073000
发表于:2007-09-25 05:15:264楼 得分:0
谢谢各位参与,最终我是按照cyy1981   的做法,自己去写onpaint函数,然后去维护一个point偏移来标识图片的位置。
谢谢大家!


快速检索

最新资讯
热门点击