导航:首页 > 文字图片 > aspnet图片文字

aspnet图片文字

发布时间:2022-08-03 20:11:28

㈠ aspnet 处理文字图片的一个问题

根据输入文字的Length,字体的大小,去计算出每一个字的宽度,,iwidth
Length*iwidth 就得到 总宽度了,,,
以前做过这类图,,用的方法就是这样的。
然后实例bitmap的时候用上面计算得到的 宽度不就成了

没有AutoSize 的属性。。。

㈡ asp.net/C#形成点阵字体的图片

using System.Drawing;

checkcode是存放字符串的

int iwidth = (int)(checkCode.Length * 11.5);
System.Drawing.Bitmap image = new System.Drawing.Bitmap(iwidth, 20);
Graphics g = Graphics.FromImage(image);
Font f = new System.Drawing.Font("Arial", 10, System.Drawing.FontStyle.Bold);
Brush b = new System.Drawing.SolidBrush(Color.Blue);
g.Clear(Color.Snow);
g.DrawString(checkCode, f, b, 3, 3);

System.IO.MemoryStream ms = new System.IO.MemoryStream();
image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
Response.ClearContent();
Response.ContentType = "image/Jpeg";
Response.BinaryWrite(ms.ToArray());
g.Dispose();
image.Dispose();

㈢ c#怎么做到图片文字识别

怎么做到图片文字识别,使用ocr文字识别软件,便可以做到的,参考方法如下:
第一步:在电脑上运行ocr文字识别软件(推荐迅捷文字识别),关闭上面的提示窗;
第二步:通过左上角的添加文件按钮,将需要识别的图片添加进去;
第三步:点击一键识别按钮,开始进行图片文字识别。
以上的三步操作便是图片文字识别的全部步骤了,希望可以帮助到您!

㈣ c# winform中 怎么识别图片上不规则的汉字

sift算法,网上现在有C#版的源码,可以识别模糊的汉字,但是还得配合第三方的文字库才能工作,自己写的话基本上没可能,汉王有款工具可以识别汉字,但是好像抗干扰的能力比较差

㈤ asp.net(C#)上传图片时添加文字水印在右下角上

try
{
string filepath = uploadFile.Value;//上传图片的路径
string newName = DateTime.Now.ToString("yyyyMMddHHmmss");//图片新名字
string filehz = filepath.Substring(filepath.LastIndexOf(".") + 1).ToLowerInvariant();//后缀名
string uploadpath = Server.MapPath("./images/update/" + newName + "." + filehz);//服务器保存图片路径

if (!(uploadFile.PostedFile.ContentLength > 0))
{
lblErrInfo.Text = "没有选择文件";
}
else
{
if (filehz == "jpg" || filehz == "gif" || filehz == "png")
{
if (File.Exists(uploadpath))
{
lblErrInfo.Text = "已经有同名文件";
}
else
{
if (chboxIsInfo.Checked == true)//加版权信息
{
if (txtLeft.Text.Trim() == "" || txtRight.Text.Trim() == "" || txtAddInfo.Text.Trim() == "")
{
Response.Write("<script>alert('请输入信息位置(半角数字)和信息文本!')</script>");
}
else
{
uploadFile.PostedFile.SaveAs(uploadpath);
lbtnDelImage.Visible = true;
btnUpdate.Enabled = false;
uploadFile.Visible = false;
txtGameImage.Text = "images/update/" + newName + "." + filehz;
System.Threading.Thread.Sleep(1000);
System.Drawing.Image img = System.Drawing.Image.FromFile(uploadpath);
lblImgWidth.Text = img.Width.ToString();
lblImgHeight.Text = img.Height.ToString();

int width, height, left, right;
width = Int32.Parse(lblImgWidth.Text);
height = Int32.Parse(lblImgHeight.Text);
left = Int32.Parse(txtLeft.Text.Trim());
right = Int32.Parse(txtRight.Text.Trim());
System.Threading.Thread.Sleep(1000);

//添加信息
string file = Server.MapPath("./" + txtGameImage.Text);
string newfile = "images/update/" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".jpg";
string strAddInfo = txtAddInfo.Text;
System.Drawing.Image oldimage = System.Drawing.Image.FromFile(file);
Response.Clear();
Bitmap output = new Bitmap(oldimage);
Graphics gh = Graphics.FromImage(output);

string ColorHex = SelColor.Value;
int r = Int16.Parse(ColorHex.Substring(0, 2), System.Globalization.NumberStyles.AllowHexSpecifier);
int g = Int16.Parse(ColorHex.Substring(2, 2), System.Globalization.NumberStyles.AllowHexSpecifier);
int b = Int16.Parse(ColorHex.Substring(4, 2), System.Globalization.NumberStyles.AllowHexSpecifier);
Color NewColor = Color.FromArgb(r, g, b);

gh.DrawString(strAddInfo, new Font(ddlFont.SelectedValue, int.Parse(ddlFontSize.SelectedValue)), new SolidBrush(NewColor), left, right);
output.Save(Server.MapPath(newfile), System.Drawing.Imaging.ImageFormat.Jpeg);

Response.ContentType = "image/gif";
ImgPreview.ImageUrl = newfile;
ImgPreview.Visible = true;
oldimage.Dispose();
txtGameImage.Text = newfile;
img.Dispose();
File.Delete(file);
}
}
else//不加版权信息
{
uploadFile.PostedFile.SaveAs(uploadpath);
lbtnDelImage.Visible = true;
btnUpdate.Enabled = false;
uploadFile.Visible = false;
txtGameImage.Text = "images/update/" + newName + "." + filehz;
System.Threading.Thread.Sleep(1000);
System.Drawing.Image img = System.Drawing.Image.FromFile(uploadpath);
lblImgWidth.Text = img.Width.ToString();
lblImgHeight.Text = img.Height.ToString();
Response.ContentType = "image/gif";
ImgPreview.ImageUrl = txtGameImage.Text;
ImgPreview.Visible = true;
img.Dispose();
}
SizeToSize();
}
}
else
{
Response.Write("<script>alert('只能上传jpg|gif|png格式的图片!')</script>");
}
}
}
catch
{
Response.Write("<script>alert('上传图片出错!')</script>");
}
以前写的上传代码
left, right分别代表版权信息的X,Y轴,这里是自己输入的,你可以通过对你输入的版权信息的字符像素长度和图片的宽,高计算得到。
ddlFont.SelectedValue 字体选择
int.Parse(ddlFontSize.SelectedValue)) 字体大小
new SolidBrush(NewColor) 字体颜色

㈥ C# winform:我要向 一张图片中添加文字,添加文字后直接展示,不保存图片,直接展示

问话也不把自己的情况说清楚,是。net还是winform啊?你要怎么展示啊?
图片框位置是固定的么?
我教你取个巧,你把图片上方在放个label,然后把图片和文字分别放在图片框和对应的label上,不就完事了~

如何使用C#实现Listview显示图片与文字

把ListView的View设置成:LargeIcon
再添加一个ImageList。把ListView的LargeImageList绑定到这个ImageList上。
动态添加方法:
ListViewItemLV=newListViewItem("内容");
IL.Images.Add(newBitmap(GetImageStream("图片地址")));
LV.ImageIndex=IL.Images.Count-1;

文件流获取方法:

PublicFunctionGetImageStream(ByValURLAsString)AsImage
DimIMGAsImage=Nothing
DimNetNetAsSystem.Net.HttpWebRequest=Nothing
NetNet=CType(Net.WebRequest.Create(URL),Net.HttpWebRequest)
DimmyResponseAsNet.HttpWebResponse=CType(NetNet.GetResponse(),Net.HttpWebResponse)
DimdataStreamAsIO.Stream=myResponse.GetResponseStream
IMG=NewBitmap(dataStream)
myResponse.Close()
ReturnIMG
EndFunction

㈧ C# 如何把图片中的文字,提取出来

这个简单,使用ocr文字识别软件,可以把图片上的文字提取出来;
ocr还可以将提取出来的文字,保存到word文档中去;
注意使用专业的ocr哦,比如说“迅 捷ocr”这个就很专业。
希望上面的叙述可以帮助到您,请采纳!

㈨ 在C#中怎么用代码向listView中添加图片各文字

第一步:在窗体中拖入ListView控件和imageList控件;
第二步:设置imageList控件的Images属性,添加你想要的图片;
第三步:设置ListView控件的SmallImageList、LargeImageList、StateImageList属性为imageList;
第四步:编辑ListView控件项的ImageIndex行为你就会发现图片成功显示出来了!
附:在ListView控件中添加选项的代码
private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text == "")
{
MessageBox.Show("添加的内容不能为空");
textBox1.Focus(); //获取焦点

}
else
{
if (listView1.Items.Count > 0) //判断列表框中是否有项
{
//循环比较是否有重复项,有则放弃添加
for (int i = 0; i < listView1.Items.Count; i++)
{
if (string.Compare(listView1.Items[i].Text.ToString(), textBox1.Text) == 0)
{
MessageBox.Show("项目重复,不能添加!");
textBox1.Text = ""; //清空文本框
textBox1.Focus();
return;
}
}
listView1.Items.Add(textBox1.Text.ToString());
textBox1.Text = "";
}
else
{
listView1.Items.Add(textBox1.Text.ToString()); //将文本框中的数据添加到列表框
textBox1.Text = "";
}

}
}

㈩ aspnet 图像上怎么画点

用BitMap类实例的SetPixel()方法这是绘制图片的前景噪音点

阅读全文

与aspnet图片文字相关的资料

热点内容
摔倒图片女孩受伤 浏览:266
q版古风女孩图片超萌 浏览:81
弹琵琶小女孩图片 浏览:338
齐肩短发漫画女孩图片高冷 浏览:66
阳台晾衣服图片女 浏览:373
动漫图片女古装 浏览:56
机械设备如何粘贴操作规程的图片 浏览:604
男生头发十厘米图片 浏览:556
头像古风图片女生真人 浏览:916
伊万卡的衣服图片 浏览:167
动漫衣服素材图片古风 浏览:41
创业图片动漫大全 浏览:59
计算机word字体组个个按钮的图片 浏览:214
变性女孩图片大全 浏览:622
简单积木图片大全 浏览:20
项链饰品图片及价格 浏览:515
按肩动漫图片 浏览:816
好孕卡通图片可爱 浏览:885
男生最丑动漫头像图片 浏览:862
夏天马路图片大全 浏览:999