|
What I just tried out which works, you can also convert the image to grayscale with the ColorMatrix class used above, just set the matrix to
cmxPic.Matrix00 = 0.299f;
cmxPic.Matrix01 = 0.299f;
cmxPic.Matrix02 = 0.299f;
cmxPic.Matrix10 = 0.587f;
cmxPic.Matrix11 = 0.587f;
cmxPic.Matrix12 = 0.587f;
cmxPic.Matrix20 = 0.114f;
cmxPic.Matrix21 = 0.114f;
cmxPic.Matrix22 = 0.114f;
This will produce a grayscale image with a different approach as presented in the aricles.
Hope this helps
modified 12-Sep-18 21:01pm.
|
|
|
|
|
hi again friends,
i have an image and i want to make it white and black. how can i do that?
thanks
|
|
|
|
|
Sajjad Izadi wrote: i have an image and i want to make it white and black. how can i do that?
Do you mean programmatically?
If not, then this is the wrong forum, but you could use Photoshop or similiar to do that.
Kristian Sixhoej
"Failure is not an option" - Gene Kranz
|
|
|
|
|
Yes , what is the probloem?
|
|
|
|
|
Here you go[^]
If you want to get in touch with image processing, then I also recommend the parts 2-5 from the series, they're really interesting and helpful.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
your suggested project was great but what is the parts 2-5 from the series? please give some more explanation about them
|
|
|
|
|
|
that was again great, thank you
|
|
|
|
|
hi friends,
How can i descover that what is the current screen resolution (1027*768 or 1152*864 or etc)?
|
|
|
|
|
Screens.PrimaryScreen, from memory
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
that worked, thanks a lot
|
|
|
|
|
im using the following code snippet to find mispelled words and highlight them...
PhoenixText.Forms.MdiWindow win = (PhoenixText.Forms.MdiWindow)this.ActiveMdiChild;
Char[] characters = win.TextBox.Text.ToCharArray();
bool stop = false;
foreach (string word in win.KeyWords)
{
for (int p = 0; p <= win.TextBox.Text.Length;p = p)
{
int endIndex = p;
foreach (char lett in characters)
{
if (stop == false)
{
if (lett.ToString() != " ")
{
endIndex++;
}
else
{
stop = true;
}
}
}
win.TextBox.Select(p, endIndex);
win.TextBox.SelectionColor = Color.Red;
win.TextBox.ForeColor = Color.Black;
p = endIndex + 1;
}
}
The problems are...
1. It wont just highlight 1 word
2. The RichTextBox's forecolor gets changed to red so that when you type oiut more text, its all red.
If anyone know how to fix these problems, thanks in advance.
|
|
|
|
|
use the string's split method to break your text into words, instead of chars.
I'm not sure how to fix issue b.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
Fixed it!!!
SpellCheck checker = new SpellCheck();
PhoenixText.Forms.MdiWindow win = (PhoenixText.Forms.MdiWindow)this.ActiveMdiChild;
Char[] characters = win.TextBox.Text.ToCharArray();
foreach (string word in win.KeyWords)
{
int firstIndex = win.TextBox.Text.IndexOf(word);
int lastindex = word.Length;
if (checker.CheckSpelling(word) == false)
{
win.TextBox.Select(firstIndex, lastindex);
win.TextBox.SelectionFont = new Font(win.TextBox.Font, FontStyle.Underline);
win.TextBox.DeselectAll();
win.TextBox.Refresh();
}
}
|
|
|
|
|
|
to get text from a textbox you just call textbox.text. But i'm not understanding, you have this code in the "Page.Load" event, how can anyone type in a contact in the textbox if this code executes when you first visit the page?
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
1 - ask ASP.NET questions in the ASP.NET forum
2 - just use the text property, obviously
3 - have you considered using better variable names than gridview1 ?
4 - have you considered not putting database code in your presentation layer ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
How can I update the contents of my PAD file automatically.
I need to update the following
+ Program Version from Assembly Version of the main exe
+ Release Date based on the current system date
+ Size of the Zip file containing my project exe and data files
I understand this would require some parsing of PAD files. What I'm looking for is a tool which can help me do that. If there is none I may write my own utility.
Thanks
Sukhjinder...
Mods, please move this post to the correct forum
Looking for help on my OpenSource Media Player LetsYo
|
|
|
|
|
i think for your first and second question you should expand the 'properties' folder from solution explorer and double click on 'AssemblyInfo.cs'. you can change what you want there.
|
|
|
|
|
In my program the exe's version number is being auto generated via the statement [assembly: AssemblyVersion("0.8.2.*")]
So I'm not concerned about it.
What I want is that the latest version number, Release date be auto updated in my PAD file...
Looking for help on my OpenSource Media Player LetsYo
|
|
|
|
|
What are you trying to accomplish exactly? Create a PAD file for your project automatically when you build it?
I.e. you click one button it zips it all up, creates the PAD file and zips everything up?
I doubt it. If it isn't intuitive then we need to fix it. - Chris Maunder
|
|
|
|
|
I've already created a utility which copies and zips up my project files. What I really need is some tool which can update my PAD file by reading the project exe.
Updations to be made in PAD file are
1) Program version read from project exe
2) Release date, current system date
The tool just needs to parse the PAD XML data and update it with the latest exe information.
Looking for help on my OpenSource Media Player LetsYo
|
|
|
|
|
1) You can get the version from an executable project.exe with this code:
private static Version GetVersion(string assemblyUri)
{
Assembly assembly = Assembly.LoadFile(assemblyUri);
return assembly.GetName().Version;
}
2) This is a little more complicated, you can extract the build date from the assembly provided that you leave the AssemblyVersion in the format x.x.*.* where the *s are replaced by the compiler. There's a discussion about it here[^].
Personally I'd to the last suggestion and create a custom build event to embed it into the assembly, it's the most reliable method.
I doubt it. If it isn't intuitive then we need to fix it. - Chris Maunder
|
|
|
|
|
Thanks for the help. It seems I'll have to write my own utility.
Thanks...
Looking for help on my OpenSource Media Player LetsYo
|
|
|
|