|
Hi everyone,
I am looking for a free implementation of a line graph control.
What I want to do with the control:
I have a file which contains line by line of status information:
000000000 00
000000001 0A
000000015 FC
....
These values represent the pin status of a "simulated" chip.
The first nine digits are some kind of "cycle"-count and the 2 hex-digits represent the pin status (binary).
The above means:
On cycle 0, all pins are 0.
On cycle 1, pins 5 and 7 are 1, all others 0 (00001010)
etc.
I need to present this data as a line graph.
(approx. like this:
---____-__-_____---,
just w/ vertical lines in between )
Then, this line-graph control should accept some kind of data-grid containing the information for each line, so I can simply manipulate point information instead of having to implement that myself.
There should be captions along the X-axis, as well as some way to select a range which should be drawn (along with zooming/stretching and automatic captioning), so I can zoom "into" the graph without to much hassle.
This is no commercial program, but rather a project for vocational school, so I do neither have the time nor the resources to write up that control myself.
I do believe that I once ran across a control which was capable of doing to here on CodeProject, but I am currently unable to find it (I've been trying to find it again for 3h straight).
If this is the wrong section, I apologize, but I was pretty sure the control I saw had "C#" in its "description".
I appreciate any help
Cheers
Sebastian
|
|
|
|
|
I forgot:
Q: WHAT kind of program are you developing?
A: The text file mentioned above is used as input for some kind of electronics simulation software. There is no graphical editor included, so
the project is to write one.
This means, when it is done, I want to be able to graphically edit and display the information contained in those files.
Sorry
Cheers
Sebastian
|
|
|
|
|
Hello,
I'm implementing an exception management application block in C# and I'm facing a problem. I would like to get a reference to the caller object of another object method I'm currently in, if it is possible. Let me precise that I don't want this reference to be a parameter of my method. Could anyone help me?
Thanks,
Didier
|
|
|
|
|
Hopefully this code helps:
static void Method1a()
{
Method2();
}
static void Method1b()
{
Method2();
}
static void Method2()
{
StackTrace st = new StackTrace();
StackFrame frame = st.GetFrame(1);
Console.WriteLine("I am Method2, I was called from {0}",frame.GetMethod().Name);
}
If you call it like this:
Method1a();<br />
Method1b();
You get this output:
I am Method2, I was called from Method1a
I am Method2, I was called from Method1b
|
|
|
|
|
Hi,
how can I get the information whether the key Enter is pressed in the DataGrid? The events KeyDown or Keypress did not fire. If I press "G" for example or other simple letters both events are firering, but not if the specific key enter is pressed.
What can I do?
Thanx Steffen
|
|
|
|
|
when i'am using your project of the twain that return image from the scanner available there is a function called transfer that return arraylist of image handeler it's ok but the main problem which i face it is :
when i create a new object of Bitmap
then:
Bitmap testimage = new Bitmap(System.Drawing.Image.FromHbitmap(HBmp),Width,Hieght);
where HBmp-->> is the imageHandeler
it raise an exception:
System.Runtime.InteropServices.ExternalException' occurred in system.drawing.dll
so,any one can help??
thanks alot
|
|
|
|
|
This sounds like you are referring to someone's article, if that is the case, you may wish to ask your question in the forum attached to the bottom of their article, this way the author will receive you question via email.
- Nick Parker My Blog | My Articles
|
|
|
|
|
hello everybody,
in first time sorry about my english because is not very good.
I'm doing a program that has to control the number of pages people can print in the printer of my server. I'm using Active Directory to see the number of pages, and pause, resume and/or cancel the print job. the problem is when people print some copies of a document of word pad, acrobat reader or a page from internet explorer. in the windows print queue only appears the first copy and my program only see the fist copy too. this is a big problem because people can print 100 copies and pay only 1!!!!
how can i see the number of copies that one user has sended to print to the printer in the server?
thank's
sergio
|
|
|
|
|
This is a known issue in printer monitoring and the only bulletproof solution is to parse the sppol file and count the actual pages sent to the printer yourself.
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
thank you.
but, how can I do this? how can I read the spool file?
thank you again
Sergio
|
|
|
|
|
In Settings->Printers select one printer and in Properties select the check box "Keep documents after they have printed".
Now when you print something the spool file will be in C:\winnt\system32\spool\printers\ directory and you can look at it with a text editor.
Spool files come in a number of possible formats. If it is in EMF format then:
(Note that this format is not documented and will be liable to change
in future releases of the Windows OS family so any code you write
based on this information should be flexible enough to be added to)
Layout of an EMF spool file:
The EMF file consists of a chain of spool records which can be
described as:
Private Structure EMFMetaRecordHeader
Dim iType As SpoolerRecordTypes
Dim nSize As Int32
End Structure
These records are read sequentially to create the printed document.
Currently the record types that I have discovered are:
Private Enum SpoolerRecordTypes
SRT_EOF = &H0 'End of file
SRT_RESERVED_1 = &H1
SRT_FONTDATA = &H2 'Font Data
SRT_DEVMODE = &H3 'Device Mode (DEVMODE)
SRT_FONT2 = &H4 'Font Data
SRT_RESERVED_5 = &H5
SRT_FONT_MM = &H6 'Font Data (Multiple Master)
SRT_FONT_SUB1 = &H7 'Font Data (SubsetFont 1)
SRT_FONT_SUB2 = &H8 'Font Data (SubsetFont 2)
SRT_RESERVED_9 = &H9
SRT_UNKNOWN = &H10
SRT_RESERVED_A = &HA
SRT_RESERVED_B = &HB
SRT_PAGE = &HC 'Enhanced Meta File (EMF)
SRT_EOPAGE1 = &HD 'End Of Page
SRT_EOPAGE2 = &HE 'End Of Page
SRT_EXT_FONT = &HF 'Ext Font Data
SRT_EXT_FONT2 = &H10 'Ext Font Data
SRT_EXT_FONT_MM = &H11 'Ext Font Data (Multiple Master)
SRT_EXT_FONT_SUB1 = &H12 'Ext Font Data (SubsetFont 1)
SRT_EXT_FONT_SUB2 = &H13 'Ext Font Data (SubsetFont 2)
SRT_EXT_PAGE = &H14 'Enhanced Meta File
SRT_JOB_INFO = &H10000
End Enum
So for example a very simple one page print job might consist of an
SRT_DEVMODE record followed by a SRT_PAGE followed by a SRT_EOF.
Within the SRT_PAGE and SRT_EXT_PAGE record is a single printed page
stored as a standard EMF record which can be displayed on screen or
transformed into any other graphics format as you wish. The
structure of this is:
1. EMF Header record which gives the version information and page
size etc needed to scale the metafile
2. A selection of EMF records which describe the infividual graphic
elements of the page (text, lines, etc.) The format of these
individual records is documented on MSDN.
Withing the SRT_DEVMODE is a record which is very similar to the
DEVMODE structure used in printer API calls that specifies things
like the number of copies, print quality, paper source etc.
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
|
Hi.
I have a problem downloading a file from the server into the user's machine.
I have the file in a directory on the server and now I want to download it or save it into the user's machine. The problem is that when I use
Client.DownloadFile(path_file_on_the_server.dat , "C:\\mysavedfile.dat")
or
StreamWriter sr = File.CreateText(fullPath);
it always saves the file INTO the server and not in the user's machine.
I just want to copy the file from the server into the user's machine.
Thank you all in advance
|
|
|
|
|
If the file is shared you can create a FileInfo object using "\\server\path" and then call CopyTo() .
If that doesn't work then have a function return the bytes for the file. Use the FileStream to write to disk. Depending on the size of the file you might want to split the file up.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
I can get the message device tpye DBT_DEVTYP_VOLUME,but my WndProc cann't get the DBT_DEVTYP_DEVICEINTERFACE message device type.My code is:
const int WM_DEVICECHANGE = 0x0219;
public enum DEVICETYPE:int
{
DBT_DEVTYP_OEM =0x00000000,// oem-defined device type
DBT_DEVTYP_DEVNODE = 0x00000001, // devnode number
DBT_DEVTYP_VOLUME = 0x00000002, // logical volume
DBT_DEVTYP_PORT = 0x00000003, // serial, parallel
DBT_DEVTYP_NET =0x00000004, // network resource
DBT_DEVTYP_DEVICEINTERFACE =0x00000005 //device interface class
}
public struct _DEV_BROADCAST_HDR
{
public int dbch_size;
public DEVICETYPE dbch_devicetype;
private int dbch_reserved;
}
public struct _DEV_BROADCAST_VOLUME
{
public int dbcv_size;
public DEVICETYPE dbcv_devicetype;//Set to DBT_DEVTYP_VOLUME
private int dbcv_reserved;
public uint dbcv_unitmask;
public int dbcv_flags;
}
public struct _DEV_BROADCAST_DEVICEINTERFACE
{
public int dbcc_size;
public DEVICETYPE dbcc_devicetype; //Set to DBT_DEVTYP_DEVICEINTERFACE
public int dbcc_reserved;
public System.Guid dbcc_classguid;
//char dbcc_name[1];
}
protected override void WndProc(ref Message devicemsg)
{
_DEV_BROADCAST_DEVICEINTERFACE
DevBroadcastInterface;
DEVICEEVENT Eventtype;
_DEV_BROADCAST_HDR Whicheventtype;
_DEV_BROADCAST_VOLUME DevBroadcastVolume;
uint unitmask;
uint drivenum=0;
StringBuilder thecomingdevicevid = new StringBuilder();
StringBuilder thecomingdevicepid = new StringBuilder();
base.WndProc(ref devicemsg);
if(devicemsg.Msg == WM_DEVICECHANGE)
{
Eventtype = (DEVICEEVENT)devicemsg.WParam.ToInt32();
switch(Eventtype)
{
case DEVICEEVENT.DBT_DEVICEARRIVAL:
{
Whicheventtype = (_DEV_BROADCAST_HDR)Marshal.PtrToStructure(devicemsg.LParam,typeof(_DEV_BROADCAST_HDR));
/*breakpoint*/ switch(Whicheventtype.dbch_devicetype)
{
case DEVICETYPE.DBT_DEVTYP_DEVICEINTERFACE:
{//this case can not be retrieved,why?
DevBroadcastInterface = (_DEV_BROADCAST_DEVICEINTERFACE)Marshal.PtrToStructure(devicemsg.LParam,typeof(_DEV_BROADCAST_DEVICEINTERFACE));
//do something here.
break;
}
case DEVICETYPE.DBT_DEVTYP_VOLUME:
{// but this case can be retrieved.
DevBroadcastVolume = (_DEV_BROADCAST_VOLUME)Marshal.PtrToStructure(devicemsg.LParam,typeof(_DEV_BROADCAST_VOLUME));
//do something here.
break;
}//end case DBT_DEVTYP_VOLUME
}//end switch(pDevBroadcastHdr.dbch_devicetype)
}//end case DBT_DEVICEARRIVAL
break;
}//end switch(Eventtype)
}//end if
}//end WndProc()
Why does the WndProc can not retrive the DBT_DEVTYP_DEVICEINTERFACE message device type?
Thanks!
|
|
|
|
|
Why post the same question twice
Cheers,
Paul Wilson
|
|
|
|
|
Hi!
The first one is too long and I think maybe no one want to read such a long question.So,I changed something to make it more readable.That's why I post the same question twice. If I do something wrong,I just wanna say I'm sorry.
Thanks!
momer
|
|
|
|
|
hi, i've drawn using GDI+ onto a form. now i need to save this drawing as bitmap. i used double buffering. my coding:
bt = new Bitmap (800,600); //delare bitmap
myGraphics = Graphics.FromImage(bt); //declare Graphics
private void btnSave_Click(object sender, System.EventArgs e)
{
SaveFileDialog saveFileDialog1 = new SaveFileDialog();
saveFileDialog1.Title ="Save File";
saveFileDialog1.Filter = "Bitmaps (*.bmp)|*.bmp";
if ((saveFileDialog1.ShowDialog() == DialogResult.OK))
{
string strFileName = saveFileDialog1.FileName;
bt.Save(strFileName,ImageFormat.Bmp); //is it the way?
}
}
how do i capture the drawing i did n save it?
Chris
|
|
|
|
|
nuttynibbles1984 wrote:
is it the way?
Did you try it? What happened? Was there an Error?
Your 1 question leads to 3 - go figure.
|
|
|
|
|
i managed to save the bitmap, but the outcome was just this black rectangle. none of my image were capture. i've search many webby, i think this method is correct, or almost
Chris
|
|
|
|
|
|
Hi!
We are seriously looking for an obfuscator. Most solutions are very expensive, but Xenocode[^] is fair priced. Anyone has an opinion on it?
Also, we're not sure if we should buy the basic or enterprise edition. The only feature we'd need in Enterprise would be string encryption, but then again... I'm not sure if we really need this. The basic edition included the ability to crash ILDASM. Would that be enough?
Our application is distributed to a small number of customers (about 50 small businesses).
Is there any other solution in the same price range I should check out?
Thanks!
Carl
|
|
|
|
|
In the follow code:
hDevInfo = SetupDiGetClassDevs(ptrGUID,
null,
null,
DIGCF_PRESENT|DIGCF_DEVICEINTERFACE);
if( hDevInfo == INVALID_HANDLE_VALUE)
{
MessageBox.Show("Can not get information set of this device class!", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
how to define INVALID_HANDLE_VALUE in my c# code?
|
|
|
|
|
Within your class define the value as the following:
private const UInt32 INVALID_HANDLE_VALUE = 0xffffffff;
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hi!Nick,
Thank you very much!I have settled this matter under your help.
Now when I finished my code,I found a nother problem,which I posted it on this board as you can see.
I hope you can give me some tips.
Thank you again!
Best regards!
momer
|
|
|
|