|
icecool_56 wrote: if there is a way to find how much is there "red" "blue" and "green" in an image? is there any method for that ?
Only if you write it. There's nothing in the .NET BCL that will do this for you. Search the articles for "image processing per pixel filters" and you'll find a string of articles by Christian Graus that you can use to built your own method quite easily.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
|
Hi Friends,
I have a requirement for the DataGridView of Windows Forms and is explained as follows:
1. I have a Quantity textbox in the DataGridView.
2. When the user enter the quantity > 1 (say 3), a total of 3 rows should
be added including the current row with the row quantity in all the rows as 1.
3. This should be achieved only when the user hits the Enter key in the
current cell.
4. If the row where the quantity being modified is in the middle of the grid, the rows next to the current row should get re-positioned based on the number of new rows added.
eg:
ProductDesc Qty (TextBox)<br />
Compaq Laptop 3 <br />
DELL DesktopPC 1
When Enter key is pressed in the quantity textbox (for the product Compaq Laptop), the output in the grid should be as follows:
ProductDesc Qty (TextBox)<br />
Compaq Laptop 1 <br />
Compaq Laptop 1<br />
Compaq Laptop 1<br />
DELL DesktopPC 1
I have tried with a couple of existing events of the DataGridView but I couldn't achieve.
Please help me with some suggestions.
Thanks.
Subrahmanyam K
|
|
|
|
|
Most likely, your DataGridView has a DataTable as data source. In this case you have to only add 3 rows in the DataTable. Rows in the DataGridView will appear automatically.
|
|
|
|
|
If your DataGridView is not databound, DataSource = null in this case, then you can use:
DataGridViewRowCollection.Add (Object[]) like:
myDGV.Row.Add(new object[] {"Compaq Laptop", 1});
myDGV.Row.Add(new object[] {"Dell DesktopPC", 1});
BUT, before, be sure that your myDGV has 2 columns with appropriate typers to hold and display your values.
|
|
|
|
|
Please don't cross post in multiple forums. I already answered in the General Discussions forum.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Exe File is deleted but its Process is still exist. Can I determine executable file size from its process on RAM?
|
|
|
|
|
Doan Quynh wrote: Exe File is deleted but its Process is still exist.
That's not possible, AFAIK. Once the .EXE starts, the file remains locked and can't be moved, renamed, opened for write access, or deleted.
Doan Quynh wrote: Can I determine executable file size from its process on RAM?
Nope. There's no correlation between the two sizes. Had you asked about a .COM application, then yes, memory size is equal to code size in the file because .COM files were a memory-image format. How the code looked in RAM was how it looked in the file. .EXE are a segmented and packed format and can very quickly expand way beyond their file size while being loaded.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
I don't thing so.I used VS2005, net frameworrk 2.0,while .exe file started and I can still delete, move or rename it. Other way, I store it in USB, after started it, I remove USB then still only its process.
I wander when .exe32 load, the length of file will load to somewhere on memory?
|
|
|
|
|
Doan Quynh wrote: while .exe file started and I can still delete, move or rename it
Oddly enough, for a Managed Code application (any .NET EXE), this is true. For native code applications, it's not.
Doan Quynh wrote: I wander when .exe32 load, the length of file will load to somewhere on memory?
Nope. It's not saved anywhere. The .EXE is literally unpacked and expanded, vaguely reminicent of a .ZIP file. There is nothing that specifies the original file size.
|
|
|
|
|
Hello everyone,
I am currently using a CSV file to store some data locally on the user's computer. Since these data is only required during the life time of the Windows Application, I was wondering if it is possible to store then in the Menory of the computer in order to speed up the process of dealing with the data contained in the CSV file?
Here is the example of the code I am using:
StreamReader streamReaderOne = new StreamReader("MyListView.txt");<br />
StreamWriter streamWriterTwo = File.AppendText("MyTemp.txt");<br />
while ((line = streamReaderOne.ReadLine()) != null)<br />
{<br />
split = line.Split(delimiterChars);<br />
line = split[0] + "," + split[1] + "," + split[2] + "," + split[3] + ",SAVE";<br />
streamWriterTwo.WriteLine(String.Format("{0}", line));<br />
}<br />
streamWriterTwo.Close();<br />
streamReaderOne.Close();<br />
<br />
File.Copy("MyTemp.txt", "MyListView.txt", true);<br />
File.Delete("MyTemp.txt");
khoramdin
|
|
|
|
|
You can pass it as a parameter to the constructor when you move between forms and the data is accessible to all the forms/class OR you could have a static property and store the data in it and retrieve it from any part of your namespace.
|
|
|
|
|
Hello Tarakeshwar Reddy,
Thanx for your reply. I am slitly confiused here. Do you mean I can pass my entire DATA which can be quiet Large as you mentioned?
Can I ask you to be more detiled with your suggestion or point me to be tutorial which you think and go into details regarding this issue?
Thank you very much and have a great day, mate.
kHORAMDIN
|
|
|
|
|
If it is large data you could probably save it in a static object. You could have a class called CSVData and that could contain some kind of static storage object which would hold that data as an XML or Dataset, etc. A static method could contain the method to access this data using some kind of parameters passed to it.
I do not have an example, but lets say you have a settings file for you project, you can load them at the startup of your program and the values from that are stored as static properties in a class file(FormColor, Font, BackColor, ForeColor, .....). So make the class read the data once and store it in static properties, which you can access from any part of the program.
|
|
|
|
|
I am using “System.Drawing.Printing” to print a drawing. Drawing consists a lot of rectangles, and lines. Actually my drawing is very large in size. Can any one tell me how can I devide drawing into pages. I will be thankful to you.
Regards,
|
|
|
|
|
get size of your drawing. create a bitmap using, then get graphics from the bitmap. Now use that graphics object to draw your objects. After finishing drawing objects, copy image to PrintPage event's
argument's graphics object.
Bitmap bmp=new Bitmap(width,height);<br />
Graphics g=Graphics.FromImage(bmp);<br />
<br />
Graphics gr=e.Graphics;
RectangleF rf=new RectangleF(0,0,printPageWidth, printPageHeight);<br />
gr.DrawImage(bmp,rf);<br />
e.HasMorePages=true;
Sorry i'm not very legible. But hope you will get an idea.
Aman Tur
modified 9-Jul-22 21:01pm.
|
|
|
|
|
Is it possible to call a java method, with parameters, from a c# program?How?I have to pass text to a java program from c#, receiving an answer.
|
|
|
|
|
|
Hi,
Askalo wrote: Is it possible to call a java method, with parameters, from a c# program?How?I have to pass text to a java program from c#, receiving an answer.
method or program ?
if you have the source of the Java method you can build a dll using J#.NET and
call its classes/methods as if they were C#.
if you have a program, its language does not matter. You can start it with the Process class
and alter its standard input, output, error streams.
|
|
|
|
|
Hi everybody !!!
i want draw a hexagon on form of c#.net. who can help me !!please guide me step by step and the most detail!!i need urgent !!hurry up please !!!! thank so much !!!!!!!!
contact Me : father_and_son_822003@yahoo.com.
|
|
|
|
|
switch(field)
{
case "A":
break;
case "B":
break;
default:
break;
}
|
|
|
|
|
|
well, we make a custom control . its a custom date time control . it has three textbox and a DateTimePicker .
On the validating event of the control,the code checks if the date is valid or not. if the date is not valid the event sequence is cancelled so that the control doesnot loose the focus . well the control works fine .
BUT THE PROBLEM IS , when the control is used in TabedPane,it does fire validating event but doesnot retain focus.
|
|
|
|
|
well, we make a custom control . its a custom date time control . it has three textbox and a DateTimePicker .
The user can either enter date through the textbox or select a date from the DateTimePicker. On the validating event of the control,the code checks if the date entered through the textbox is valid or not. if the date is not valid the event sequence is cancelled so that the control doesnot loose the focus . well the control works fine .
BUT THE PROBLEM IS , when the control is used in TabedPane,it does fire validating event but doesnot retain focus.
|
|
|
|
|
First, find what what's stealing the focus. See if there's some way to programmatically prevent that from receiving focus. Or, manually add focus through code when you need it.
|
|
|
|
|