智能手写体识别系统

在同一命名空间下添加子窗体,选择类型为windows窗体
在这里插入图片描述在这里插入图片描述控件splitcontainercontrol:控件使用1 控件使用2
dock属性设置为fill可以实现窗体的填充
嵌套使用效果很不错:(三重嵌套)
Fixedpanel属性设置为None,可以窗口大小改变后保持控件分割比例
三重嵌套控件label常用属性参考:label常用属性
label设置文字居中方法:C# Winform label自定义大小与居中
总结分一下三步:
1.将AutoSize属性设置为False;
2.将Dock属性设置为Fill;
3.将TextAlign属性设置为居中。

控件属性总结到位:
dock停靠
anchor锚定

//设置树节点显示复选框

this.treeList1.OptionsView.ShowCheckBoxes = true;

如何使图片大小适应pictureBox的大小

if (mOrgImgCpy != null)
{
	Bitmap bm = new Bitmap(mOrgImgCpy, pictureBox1.Width, pictureBox1.Height);
	pictureBox1.Image = bm;
	return;
}

条形码控件:control’s boundaries are too small for the barcode

利用Aspose.Pdf.Facades修改FDF,控件常用方法及属性:常用方法及属性

 // adding image stamp
System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(Resource1.esign_sample);
MemoryStream imagestream = new MemoryStream();
bmp.Save(imagestream, System.Drawing.Imaging.ImageFormat.Jpeg);

Aspose.Pdf.Facades.Stamp imageStamp = new Aspose.Pdf.Facades.Stamp();
imageStamp.BindImage(imagestream);
imageStamp.SetOrigin((float)lowerLeftX, (float)lowerLeftY);
imageStamp.SetImageSize((float)((xConversion * 2) / 0.9375), (float)(yConversion / 0.9375));
imageStamp.IsBackground = false;
imageStamp.Opacity = 1.0f;
stampCount++;

fileStamp.AddStamp(imageStamp);

// adding text stamp below image
Aspose.Pdf.Facades.Stamp textStamp = new Aspose.Pdf.Facades.Stamp();
Aspose.Pdf.Facades.FormattedText text = new Aspose.Pdf.Facades.FormattedText("Test text in stamp.", System.Drawing.Color.Black, System.Drawing.Color.White, Aspose.Pdf.Facades.FontStyle.TimesRoman, Aspose.Pdf.Facades.EncodingType.Cp1250, false, 12.0f);
textStamp.BindLogo(text);
textStamp.SetOrigin((float)lowerLeftX, (float)(lowerLeftY - (12.0f * stampCount) - (stampCount * 3)));
textStamp.Opacity = 1.0f;
textStamp.IsBackground = false;
stampCount++;

fileStamp.AddStamp(textStamp);

在这里插入图片描述如何使图片大小适合picturebox大小?
子窗体下写一个函数:

public void picture_sizechange()
{
	//一定判断一下imageSlider里面是否有图片,否则string filePath = fileName.ElementAt<string>(imageSlider1.CurrentImageIndex);这句会报索引超界的错
	if (imageSlider1.CurrentImage == null)
	{
		pictureBox1.Image = null;
		return;
	}
	string filePath = fileName.ElementAt<string>(imageSlider1.CurrentImageIndex);
	mOrgImgCpy = Image.FromFile(@filePath);
	if (mOrgImgCpy != null)
	{
		Bitmap bm = new Bitmap(mOrgImgCpy, pictureBox1.Width, pictureBox1.Height);
		pictureBox1.Image = bm;
		return;
	}
}

在主窗体程序函数Form1_resize()里面调用子窗体的函数

sonForm2.picture_sizechange();

当然也不用这么麻烦,直接在picture1.resize()函数下面写也可以。之前在索引报错搞得有点烦。

通过改下图PDFVIEWER得属性来修改图片在picturebox的显示方式
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值