toolstripstatuslabel 文字图片自动适应大小 图片自动压低拉伸

lplp768 2010-09-17 01:08:52
就是statusbar 比较低,图片较高,然后,如何让图片自动调整大小,表现出来的结果就是压低拉伸了
文字也差不多吧,不设置label本身的宽度,让文字和图片自动调节,设置什么属性啊
...全文
414 11 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
lplp768 2010-09-20
  • 打赏
  • 举报
回复
这是vb转c#,vb里的效果感觉就是图片被压缩拉伸了,c#里怎么都弄不出来,同样的效果,bloodish,说得对,可能两者自适应效果不一样吧,谢谢楼上各位了。
  • 打赏
  • 举报
回复
图片:
BackgroundImageLayout=Stretch
文字,不能吧
bloodish 2010-09-17
  • 打赏
  • 举报
回复
如果是Label.Image
默认的ImageScaling属性不就是SizeToFit吗?本身就是自适应了.
所以就不太理解你倒底想要怎样的效果了.
lplp768 2010-09-17
  • 打赏
  • 举报
回复
快下班了,有人来么?帮个忙吧,大家
lplp768 2010-09-17
  • 打赏
  • 举报
回复
顶下,再问
lplp768 2010-09-17
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 porschev 的回复:]
帮顶。。。
[/Quote]
谢拉,有人会吗??顶下,再问,注意不是背景图片啊
lplp768 2010-09-17
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 bloodish 的回复:]
图片:
BackgroundImageLayout=Stretch

文字:
似乎做不到,自己判断控件高度,动态更改FontSize

可以尝试
设置StatusBar的Font,缺省情况下其内部的所有控件都会使用父控件的设置
[/Quote]
说漏了,不是背景图片,就是显示的图片,不好意思
lplp768 2010-09-17
  • 打赏
  • 举报
回复
现在没人吗?请求帮助啊
bloodish 2010-09-17
  • 打赏
  • 举报
回复
图片:
BackgroundImageLayout=Stretch

文字:
似乎做不到,自己判断控件高度,动态更改FontSize

可以尝试
设置StatusBar的Font,缺省情况下其内部的所有控件都会使用父控件的设置
lplp768 2010-09-17
  • 打赏
  • 举报
回复
顶下再问
批量删除图片透明区 压缩图片功能 public string mSelectPath;//当前选择路径 public Form1() { InitializeComponent(); this.toolStripStatusLabel1.Text = "准备就绪"; } private void button1_Click(object sender, EventArgs e) { OpenFileDialog open = new OpenFileDialog(); open.Multiselect = true; open.Filter = "图片|*.png"; if (open.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Tools.Export(new List(open.FileNames), "D://output"); } this.toolStripStatusLabel1.Text = "图片压缩完成"; } private void button2_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.mSelectPath)) { this.toolStripStatusLabel1.Text = "路径不合法"; } else { Tools.ExportFolder(this.mSelectPath, "D://output"); this.RefershTreeView(); this.toolStripStatusLabel1.Text = "导出完成"; } } private void button3_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.mSelectPath)) { this.toolStripStatusLabel1.Text = "路径不合法"; } else { Tools.ChangeImgName(new DirectoryInfo(this.mSelectPath)); this.RefershTreeView(); this.toolStripStatusLabel1.Text = "重命名操作完成"; } } private void linkLabel1_Click(object sender, EventArgs e) { FolderBrowserDialog fb = new FolderBrowserDialog(); if(fb.ShowDialog() == System.Windows.Forms.DialogResult.OK) { this.mSelectPath = fb.SelectedPath; this.textBox1.Text = fb.SelectedPath; this.RefershTreeView(); this.toolStripStatusLabel1.Text = "选择路径:" + this.mSelectPath; } }
运行环境 .NET Framework2.0 开发工具 Microsoft Visual Studio 2005 二. 部分代码说明(主要讲解异步分析和下载): 异步分析下载采取的策略是同时分析同时下载,即未等待数据全部分析完毕就开始把已经分析出来的图片链接开始下载。下载成功的均在List框链接前面划上了√ ,未能下载的图片有可能是分析错误或者是下载异常。 1. 异步分析部分代码 /// /// 异步分析下载 /// private void AsyncAnalyzeAndDownload(string url, string savePath) { this.uriString = url; this.savePath = savePath; #region 分析计时开始 count = 0; count1 = 0; freq = 0; result = 0; QueryPerformanceFrequency(ref freq); QueryPerformanceCounter(ref count); #endregion using (WebClient wClient = new WebClient()) { AutoResetEvent waiter = new AutoResetEvent(false); wClient.Credentials = CredentialCache.DefaultCredentials; wClient.DownloadDataCompleted += new DownloadDataCompletedEventHandler(AsyncURIAnalyze); wClient.DownloadDataAsync(new Uri(uriString), waiter); //waiter.WaitOne(); //阻止当前线程,直到收到信号 } } /// /// 异步分析 /// protected void AsyncURIAnalyze(Object sender, DownloadDataCompletedEventArgs e) { AutoResetEvent waiter = (AutoResetEvent)e.UserState; try { if (!e.Cancelled && e.Error == null) { string dnDir = string.Empty; string domainName = string.Empty; string uri = uriString; //获得域名 http://www.sina.com/ Match match = Regex.Match(uri, @"((http(s)?://)?)+[\w-.]+[^/]");//, RegexOptions.IgnoreCase domainName = match.Value; //获得域名最深层目录 http://www.sina.com/mail/ if (domainName.Equals(uri

111,092

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧