導航:首頁 > 文字圖片 > 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圖片文字相關的資料

熱點內容
感謝一路有你文字圖片 瀏覽:292
word文檔圖片怎麼換成黑白色 瀏覽:96
胖子表情包圖片可愛 瀏覽:38
10塊錢真實人民幣高清圖片 瀏覽:26
手指甲圖片簡單 瀏覽:215
女生手拿雪碧圖片 瀏覽:62
圖片放在word裡面變成白色 瀏覽:29
漫畫圖片男生冷酷高傲 瀏覽:301
層次直發型圖片女背面 瀏覽:703
初一兩個男生背影圖片 瀏覽:176
美女操動態圖片百度網盤 瀏覽:513
什麼是梨花頭發型圖片 瀏覽:240
背書包的女孩圖片 瀏覽:46
小女孩看書簡筆畫圖片 瀏覽:874
女生到肩發型圖片 瀏覽:750
我想看長頭發女孩富的圖片 瀏覽:197
word圖片兩端對齊沒反應 瀏覽:954
狗咬式超短發發型圖片 瀏覽:139
怎麼另存網頁圖片不顯示 瀏覽:58
怎麼在壓縮圖片上備注信息 瀏覽:11