|
ok
what about if i want to draw in empty image by my self
dawing some images and some shapes
thanx
Generator
|
|
|
|
|
Create a Bitmap object and a Graphics object from it, then draw using the Graphics object.
---
single minded; short sighted; long gone;
|
|
|
|
|
sorry,
but can i have some explanation
i want to draw some objects in image then
save this image in disk
the save is not a problem
thanx
Generator
|
|
|
|
|
hi
Bitmap workSpaceBitmap = new Bitmap(tabctrlMain.SelectedTab.Width, tabctrlMain.SelectedTab.Height);<br />
tabctrlMain.SelectedTab.DrawToBitmap(workSpaceBitmap, tabctrlMain.SelectedTab.Bounds);<br />
workSpaceBitmap.Save("c:\\image.jpeg", ImageFormat.Jpeg);
i write this code and thanx very much for ur help(DrawToBitmap u told me about it) thanx alot
but one question if there is a scroll bar is this code will draw disappeared parts of screen to image or not
Generator
|
|
|
|
|
Hi All..
Can u please help me in displaying parent and child records in a single datagridview. My requirement is like a "+" sign should be there in a grid. On click of that + sign child rows should get displayed. How can i achieve that in windows forms. Please help me in this regard.
If anyone knows the solution, please mail me at shwethak32@yahoo.co.in or reply to this forum
Regards
Shwetha
|
|
|
|
|
I'm looking for a Windows Forms control that acts as a sort of "danger meter." Basically a ProgressBar that gradiates from green (when the "progress" is low) to red (when high). But basically I just can't find the right keywords; everything I search for gives me a totally different type of control.
Any ideas?
-Domenic Denicola- [CPUA 0x1337]
“I was born human. But this was an accident of fate—a condition merely of time and place. I believe it's something we have the power to change…”
|
|
|
|
|
Check out
http://www.codeproject.com/cs/system/CpuUsage.asp[^]
This is a control which monitors CPU usage and shows a progress bar accordignly - like the Task Manager thing.
I'm sure you can adapt the code to be able to monitor whatever you need - changing the color of the control depending on a particular level should be pretty easy....
|
|
|
|
|
|
First of all I see that you have posted this same question on the Windows Forms forum as well - be careful because you'll just annoy people if you do,
As for the issue - check out
http://www.codeproject.com/cpp/rwformulaparser.asp[^]
I did a quick search for "formula" and guess what there's about 50 items on it on here alone. That was one of the items and it seems to be able to do more than you need,
Check that out and then if you have any questions we'll more than happy to help - but you have to put some of the effort in....
|
|
|
|
|
Wow - I just noticed that you asked the same question 5 hours ago.....
Dude - you have to do some of the work here - no-one is going to write all of the code for you - which part are you having the most trouble with?
|
|
|
|
|
iam getting trouble with columns of the table.
so pls dont mistake me.
|
|
|
|
|
Hi guys!
I got a general problem here with UDP multicasts not reaching the server I want to reach.
Perhaps there's a general misconception on my side, perhaps it's just a configuration thing, hope someone can help me out.
I want to create a dynamic service discovery. A client wants to use a service, but doesn't know which server is offering the service.
So I developed a class a service process can use to listen for service discovery requests on a given port and another class for the client to find these services. For this to work I thought I'd use UDP multicasts.
The service joins a multicast group (I've tried 224.0.0.1, 225.0.0.1, 225.1.1.1 and a few more), the client sends a datagram to one of these IP adresses, the service receives the datagram and can reply with an "I'm here" response.
This works fine if I try it within my LAN, but doesn't work if the server and client are located in different subnets. These subnets are connected via a VPN with Zyxel ZyWalls (the ZyWalls are capable of IP multicast according to the specs), yet the packets don't seem to reach the service.
If I don't send the request to a multicast address but use a subnet-specific broadcast or the real target IP, the service gets notified, but that's not what I need - I don't want to make any assumption on the subnet a service is on.
I thought multicast groups were especially designed for such a scenario? According to the documentation I found, members of multicast groups don't have to be part of the same network, so it looks like a routing problem. But unfortunately I don't have any idea what to modify to allow multicast packages to be routed to the other subnets.
Can anyone help?
Thanks in advance,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi
I am trying to check if a file is being written by another process.
I am using teh FileInfo (size) to see if the size (it is a log file) is changing.
When another process is writing to the file my application is stuck.
string fPath = @"c:\temp\build.log";<br />
FileInfo FI = new FileInfo(fPath);<br />
while (1>0)<br />
{<br />
if (lastvalue - FI.Length == 0)<br />
{<br />
iCounter++;<br />
lastvalue = FI.Length;<br />
if (iCounter > 20)<br />
{<br />
MessageBox.Show("times up");<br />
break;<br />
}<br />
<br />
}<br />
else<br />
iCounter = 0;<br />
lastvalue = FI.Length;<br />
<br />
<br />
Thread.Sleep(SleepTime);<br />
}
Any idea could help.
Have a nice Day
|
|
|
|
|
Hi!
One idea that's working fine in some of my programs is trying to open the target file exclusively (with FileShare.None ).
If the file can be opened, no other process is accessing the file and thus the file has been created completely. If you get an IOException then sleep for a few ms and try again. Just don't forget to close the file afterwards and include a timeout mechanism so your program doesn't lock up if the file isn't closed because of a bug in the other application.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Thanks for the quick reply.
I understand your suggestion but the problem is that the process holding the file is loading a message box and until i press "ok" the file is still open by it.
The messagebox is not always present .
I want to get a message when the file is not updated anymore .
Have a nice Day
|
|
|
|
|
I fear you're out of luck in this case.
As long as the file is held open by the other application, this other application is free to modify the contents of the file at any given time. So you can never be sure that the other app will not write anything to the file. Depending on the architecture of the other app it could very well be that a background thread still writes to the file even though a message box is being displayed.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi use the FileSystemWatcher class
|
|
|
|
|
Thanks a lot i will try
Have a nice Day
|
|
|
|
|
Hi,
I would like to stream the desktop image of one computer to another, over the internet. My idea is to do a screen capture at regular intervals, and send it to the receiver.
In order to reduce network load, I would like to compress each frame in function of the previous one (i.e., only the parts of the picture that have changed between two successive frames should be sent, and those parts are compressed before sending).
I suppose there must be an easy way (e.g., using a codec) to do this, but I can't seem to find it on the web/forums.
Can anyone help me out?
Thanks !
ZeJibe
|
|
|
|
|
There are no easy ways, you have to calc the diff of 2 images yourself.
|
|
|
|
|
Hi,
how i can validate a formula.
Formula contains columns of table and operators.
if suppose c1,c2,c3 are columns of table, c1 is of type string, cs is decimal and c3 is int.
formula may be a+(b*c),or a*(b/c)
lakshmi
|
|
|
|
|
c1 needs to be turned into a number, with int.TryParse or double.TryParse. Then it will just work. Otherwise, it's not possible.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
why DataView.RowFilter is more solwer than DataTable.Select function?
using the following code to test.
class Program
{
const int ROWS_COUNT = 50; // 设置处理数据大小。 单位:w 万
const int ROWS_COUNT_UNIT = 10000; // 数据行单位:万
const double ROWS_TOTAL_COUNT = ROWS_COUNT * ROWS_COUNT_UNIT; // 总循环次数
const double ROWS_SHOW_INFO_LINE = ROWS_TOTAL_COUNT / 10; // 显示进度
private static string SAVE_FILE_NAME = string.Format("{0}w_{1}", ROWS_COUNT.ToString(), DateTime.Now.ToString("yyyyMMddhhmmss"));
private static StringBuilder builder = new StringBuilder(string.Format("ROWS COUNT :{0}w\n", ROWS_COUNT));
private static DataTable mDataTable = null;
private static DataView dv = null;
private static string str = string.Empty;
static void Main(string[] args)
{
// 添加数据行
DateTime start = DateTime.Now;
AddData();
str = string.Format("cost [ {0} ms ] to add [ {1}w ] rows.\n{2}\n",
(DateTime.Now.Subtract(start).TotalMilliseconds.ToString()),
ROWS_COUNT.ToString(),
"----- AddData() END -----\n");
Console.WriteLine(str);
builder.AppendFormat(str);
// 添加 DataTable 的主键
start = DateTime.Now;
AddPrimaryKey(true);
str = string.Format("cost [ {0} ms ] to AddPrimaryKey().\n{1}\n",
(DateTime.Now.Subtract(start).TotalMilliseconds.ToString()),
"----- AddPrimaryKey() END -----\n");
Console.WriteLine(str);
builder.AppendFormat(str);
// 循环进行 10 次数据过滤测试
start = DateTime.Now;
int times = 0;
string enter = string.Empty;
while ((++times) < 11)
{
str = string.Format("running {0} times ...\n", times.ToString());
Console.BackgroundColor = ConsoleColor.Red;
Console.WriteLine(str);
Console.ResetColor();
builder.AppendFormat(str);
Test();
builder.Append("\n\n");
}
str = string.Format("\ncost [ {0} ms ] to WHILE loop.\n",
(DateTime.Now.Subtract(start).TotalMilliseconds.ToString()));
Console.WriteLine(str);
builder.AppendFormat(str);
// 测试结果输入到 文件中
WriteToFile(builder.ToString());
// 提示用户操作
Console.WriteLine("Press any key to continue ...");
Console.ReadLine();
}
///
/// 创建dataTable
///
private static void AddData()
{
Console.WriteLine("Adding data ... ");
mDataTable = null;
mDataTable = new DataTable("test");
DataColumn dc = new DataColumn("index", typeof(double));
dc.DefaultValue = 3000;
mDataTable.Columns.Add(dc);
mDataTable.Columns.Add(new DataColumn("content", typeof(string)));
DateTime start = DateTime.Now;
TimeSpan end;
double rowsCount = ROWS_TOTAL_COUNT + 1;
DataRow row = null;
for (int i = 1; i < rowsCount; i++)
{
if (0 == (i % ROWS_SHOW_INFO_LINE))
{
end = DateTime.Now.Subtract(start);
str = string.Format("Readed {0} rows [ {1} ms]...\n\n", i.ToString(), end.TotalMilliseconds.ToString());
Console.WriteLine(str);
builder.AppendFormat(str);
start = DateTime.Now;
}
// 1000w 数据时,出现了 SystemOutOfMemory 的异常
row = mDataTable.NewRow();
//row["index"] = i;
row["content"] = i.ToString();
mDataTable.Rows.Add(row);
}
mDataTable.AcceptChanges();
Console.Clear();
}
///
/// 添加主键值
///
/// <param name="add" />
private static void AddPrimaryKey(bool add)
{
Console.WriteLine("Adding Primarykey ...");
DateTime start;
if (add)
{
// add PrimaryKey columns
int key = mDataTable.PrimaryKey.Length;
DataColumn[] dcs = new DataColumn[key + 2];
dcs[key + 0] = mDataTable.Columns["index"];
dcs[key + 1] = mDataTable.Columns["content"];
start = DateTime.Now;
mDataTable.PrimaryKey = dcs;
str = string.Format("cost [ {0} ms ] mDataTable.PrimaryKey...\n", (DateTime.Now.Subtract(start).TotalMilliseconds.ToString()));
Console.WriteLine(str);
builder.AppendFormat(str);
}
start = DateTime.Now;
dv = null;
dv = mDataTable.DefaultView;
str = string.Format("cost [ {0} ms ] mDataTable.DefaultView...\n", (DateTime.Now.Subtract(start).TotalMilliseconds.ToString()));
Console.WriteLine(str);
builder.AppendFormat(str);
builder.Append("PrimaryKey Columns Details;\n");
foreach (DataColumn dc in mDataTable.PrimaryKey)
{
builder.AppendFormat("Column Name: \t{0}\nColumn DataType: \t{1}\n", dc.ColumnName, dc.DataType.Name);
}
}
///
/// 数据筛选测试
///
private static void Test()
{
const string CONDITIONS_1 = "index < 80000";
const string CONDITIONS_2 = "index < 80000 or (content LIKE '%200%')";
SelectFromDatatable(CONDITIONS_1);
SelectFromDatatable(CONDITIONS_2);
FilterDataView(CONDITIONS_1);
FilterDataView(CONDITIONS_2);
}
///
/// 将结果记录到文件
///
/// <param name="content" /><文件内容/param>
private static void WriteToFile(string content)
{
try
{
System.IO.StreamWriter sw = new System.IO.StreamWriter(string.Format("{0}.txt", SAVE_FILE_NAME), false, Encoding.UTF8);
sw.Write(content);
sw.Close();
sw = null;
}
catch (Exception exp)
{
System.Diagnostics.Debug.WriteLine(exp.Message);
}
}
///
/// 通过DataTabl.Select 过滤数据
///
/// <param name="condtions" />
private static void SelectFromDatatable(string condtions)
{
DateTime start = DateTime.Now;
start = DateTime.Now;
mDataTable.Select(condtions);
builder.AppendFormat("mDataTable.Select(\"{0}\"):\n\t{1} ms\n", condtions, (DateTime.Now.Subtract(start).TotalMilliseconds.ToString()));
}
///
/// 通过 DataTable.DefaultView.RowFilter 过滤数据
///
/// <param name="conditions" />
private static void FilterDataView(string conditions)
{
DateTime start = DateTime.Now;
start = DateTime.Now;
dv.RowFilter = conditions;
builder.AppendFormat("dv.RowFilter = \"{0}\": \n\t{1} ms\n", conditions, (DateTime.Now.Subtract(start).TotalMilliseconds.ToString()));
}
}
宝剑锋从磨砺出,梅花香自苦寒来
我欲仗剑走天涯
|
|
|
|
|
hi
i am new in c#.net.
i want to move among some records in database
for example go to the first record,last record,next record,previus record
please help me.
somi
|
|
|
|
|
1 - don't use your email as a username, it will get you spam
2 - there are tons of articles on the web on this, you should also buy a book and work through it, if you're new to C++.
All you need to do is store a number to represent the index of the record you want to read, and use that to read a record when a button is pressed.
I answered this same question the other day, worded exactly the same. Was it you ? If so, the reason you didn't understand my answer, is that you need to learn some basics first.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|