|
I have a problem with " StringSplitOptions" (cant find it)
i need to import a class or dll ?
eyalso
|
|
|
|
|
This enumeration added in framework 2.0.
If you're using framework 1.1 use this code:
<br />
string text = "This is my string";<br />
string[] words = text.Split(new char[1] { ' ' });<br />
int countWords = words.Length;<br />
Best regards, Alexey.
|
|
|
|
|
For example,you have picture(is painted with solid colors not gradiant) at mspaint,
I would like to change all X color to Y color.
How could i achive that?
Is there any method at Drawing class (i coulnd find any :'()
|
|
|
|
|
hi,
i think there is no direct method to accompolish this with C#.you have to use API like bitblt and compare the colors and change..
you can try with GDI/Graphic section...There is a lot of samples i found last time.
good luck
Where there is a will,there is a way.
|
|
|
|
|
Hi,
a simple way would be to load it as a Bitmap and to iterate over every pixel and use the GetPixel/setPixel functions on the bitmap to change pixel by pixel. As those calls are rather slow you could also go the unmanaged way. Have a look at Image Processing for Dummies by Christian Graus[^] for further details on this.
|
|
|
|
|
thank you
I found this sample so GetPixel and SetPixel is ok for me.
My new question is
my picture box is set to Strech view.
My image's width =768 , height=503
but on secreen, rightbottom corner pixel coordinat is x:460 y:261
So when i want to show color where mouse on over, it shows another color because of wrong coordinats. might i convert to coordinats?
Bitmap bitmap = new Bitmap("C:\\TV2.bmp");<br />
int width = bitmap.Width;<br />
int height = bitmap.Height;<br />
<br />
int i, j;<br />
for (i = 0; i< width; i++) <br />
{<br />
for (j=0; j<height; j++)<br />
{<br />
Color pixelColor = bitmap.GetPixel(i, j);<br />
int r = pixelColor.R;
int b = pixelColor.B;
Color newColor = Color.FromArgb(r, 0, b);<br />
bitmap.SetPixel(i, j, newColor);<br />
}<br />
}<br />
this.BackgroundImage = bitmap;
-- modified at 6:03 Friday 5th May, 2006
|
|
|
|
|
Hi,
might be difficult because the PictureBox won't reveal this. You could try to calculate it yourself (not tested):
float sw = 1f * pictureBox.Width / bitmap.Width;
float sh = 1f * pictureBox.Height / bitmap.Height;
int xPic = xMouse * sw;
int yPic = yMouse * sh;
where x/yMouse are the mouse coordinates you are getting and x/yPic should be the coordinates within the picture. But I don't know if this is accurate enough (might be that you'll also have to consider the border of the PictureBox).
|
|
|
|
|
You can also replace colors using the ImageAttributes and ColorMap classes.
Example replaces red->yellow, blue->magenta.
<br />
Graphics g = Graphics.FromImage(im);<br />
ImageAttributes attr = new ImageAttributes();<br />
<br />
ColorMap[] remap = new ColorMap[2];<br />
<br />
remap[0] = new ColorMap();<br />
remap[0].OldColor = Color.Red;<br />
remap[0].NewColor = Color.Yellow;<br />
<br />
remap[1] = new ColorMap();<br />
remap[1].OldColor = Color.Blue;<br />
remap[1].NewColor = Color.Magenta;<br />
<br />
attr.SetRemapTable(remap);<br />
g.DrawImage(im, new Rectangle(0, 0, im.Width, im.Height), 0, 0, im.Width, im.Height, GraphicsUnit.Pixel, attr);<br />
|
|
|
|
|
I want one program logic for finding the total number of occurance of specific string in files which are in specified directory.
Program will return the total number of occurances file wise.
|
|
|
|
|
|
hello frns..
pls help me on encription/decription.. i want to encrypt/decrypt a message.i am using asp.net 2005
|
|
|
|
|
Look at the System.Security.Cryptography namespace.
---
b { font-weight: normal; }
|
|
|
|
|
what are the methods,classes used for login page witch contains user name, possword.
|
|
|
|
|
hi there
I want to select a row from my datagrid but he returns me the following error.
what exactly is this error and how can i solve it?
I use visual C# 2005
'System.Windows.Forms.DataGridView' does not contain a definition for 'CurrentRowIndex'
int rowIndex = dBANBM_T075_BORGTOCHTDataGridView.CurrentRowIndex;<br />
{<br />
CustomRow(this, new CustomRowEventArgs(testdb1DataSet, dBANBM_T075_BORGTOCHTDataGridView, rowIndex));<br />
|
|
|
|
|
hi,
Datagridview dont have a currentRowIndex property
it has to be rewritten like this .
int rowIndex = dBANBM_T075_BORGTOCHTDataGridView.CurrentCell.RowIndex
or you can rewrite
CustomRow(this, new CustomRowEventArgs(testdb1DataSet, dBANBM_T075_BORGTOCHTDataGridView, dBANBM_T075_BORGTOCHTDataGridView.CurrentCell.RowIndex));
good luck
Where there is a will,there is a way.
|
|
|
|
|
i thought i doen's excist.. but it's so strange.. 'cause a normal datagird had the currentrowindex. what is so different to a datagrid or datagrid view.
i put your code in my project..
<br />
int rowIndex = dBANBM_T075_BORGTOCHTDataGridView.CurrentCell.RowIndex<br />
and he give's me the following error:
(There is no row at position 3.)
my code to read the row into a textbox =
<br />
testdb1DataSet DSet = e.DSet;<br />
DataGridView grid = e.Grid;<br />
int row = e.Row;<br />
<br />
textBox1.Text = e.DSet.Tables[0].Rows[e.Row]["T075_BORGTOCHTNUMMER_1"].ToString();<br />
|
|
|
|
|
hi,
my previous reply for that particular error message.
if you want to get a value from gridview you could use something like this
textbox1.Text = myGridView[RowIndex]["T075_BORGTOCHTNUMMER_1"].Value.ToString();
the error mentioned in your last mail related to your dataset not with datagridview...
good luck.
Where there is a will,there is a way.
|
|
|
|
|
i really feeling noob right now .. but..
The name 'RowIndex' does not exist in the current context
code =
<br />
testdb1DataSet DSet = e.DSet;<br />
DataGridView grid = e.Grid;<br />
int row = e.Row;<br />
<br />
textBox1.Text = grid[RowIndex]["T075_BORGTOCHTNUMMER_1"].Value.ToString();<br />
think i should use something like
<br />
int RowIndex = CustomRow;<br />
but then i get the error:
No overload for method 'this' takes '1' arguments
|
|
|
|
|
hi ,
textBox1.Text = grid["T075_BORGTOCHTNUMMER_1",row].Value.ToString();
sorry man, i wrote just on the fly..didnt check the syntax.
good luck.
Where there is a will,there is a way.
|
|
|
|
|
eh it works great..
<br />
textBox1.Text = grid["dataGridViewTextBoxColumn1", row].Value.ToString();<br />
i used this and it works!
only one question left..
what is the big difference between a datagrid or datagridview..
cause in some other project (made with visual studio 2003) i use a datagrid and the currentrowindex does work..
many thanks
|
|
|
|
|
change the code to this:
int rowIndex = dBANBM_T075_BORGTOCHTDataGridView.CurrentRow.Index
Thanks
Rastgar
|
|
|
|
|
Hi
I have two applications running simultaneously, from one application i want to raise event or notify second application to do something. both applications are using same db, but putting flag there will result in pooling. can someone point me to some good article concerning this.
Thanks
Shajeel
|
|
|
|
|
You can use PostMessage API function.
Best regards, Alexey.
|
|
|
|
|
Too dangerous i would have to hook a IMessageFilter in Message Queue and i dont know which message to pass, if i set it some arbitrary message windows might send that message too, is there no easy way.
Thanks for help
Shajeel
|
|
|
|
|