I tried a lot of methods, but couldn't get it exactly.
Note:winform richtextbox
Thanks for any reply.
The following code is what I tried, but it doesn't get the exact size, maybe you know why.
Anyway, this code is not important, but how do you get the right size?
string rtfTxt = richTextBox1.SelectedRtf;
Match mat = Regex.Match(rtfTxt, @"picw[\d]+");
mat = Regex.Match(rtfTxt, @"picwgoal[\d]+");
//width of image
int width = int.Parse(mat.Value.Replace("picwgoal", "")) / 15;
mat = Regex.Match(rtfTxt, @"pichgoal[\d]+");
//height of image
int height = int.Parse(mat.Value.Replace("pichgoal", "")) / 15;
label2.Text = width + "x" + height;
View my description from the picture.
If convenient, you can also try this code, source links. https://pan.baidu.com/s/1dHfcBV7