|
Nothing is wrong, that's the way it works for any served up stream. I've noticed about an 11 second delay coming from my QuickCam to the clients. The delay will vary depending on the speed on the client connection, the speed of the server machine, the speed of the machine doing the capture and encoding,... Also, some encoder must have a minimum amount of data to encode because their schemes may work over the span of a few seconds of data instead of what in front of it right now...
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hai there,
i need your valuable information. i don't have any big esposure in think client application. but now i need to do that.
i need your opinion.
which method is good,reliable,efficient,less time consuming and cost effective to store picture files (for a cart application) in sql server or any database.
Sreejith S S Nair
|
|
|
|
|
Create a binary field (like an image field type in your database to store these images. Then use a SqlParameter for your SqlCommand like so:
SqlCommand cmd = conn.CreateCommand();
cmd.CommandText = "INSERT INTO MyTable (Image) VALUES (@Image)";
SqlParameter image = cmd.Parameters.Add("@Image", SqlDbType.Image);
using (MemoryStream ms = new MemoryStream())
{
bmp.Save(ms, ImageFormat.Jpeg);
ms.Seek(0, SeekOrigin.Begin);
byte[] buffer = new byte[ms.Length];
ms.Read(buffer, 0, buffer.Length);
image.Value = buffer;
}
conn.Open();
cmd.ExecuteNonQuery();
conn.Close(); You should, of course, add some exception handling. How you get the image data isn't so much important as how you store it.
Another alternative is to use your database as a file system and only store a reference to the image files. This make it easier to display the images in a web page since you don't have to worry about either saving the images to a virtual directory when requested, or writing a handler (perhaps even an ASP.NET .aspx page) to extract the data on the fly (if you do, youmight consider caching against the query string params). This is what we do for the documen management portion of our application.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
From the article:Cutting Edge Windows Hooks in the _NET Framework -- MSDN Magazine, October 2002.htm,
i download its demo and test it.
in this function:
public void Install()
{
m_hhook = SetWindowsHookEx(
m_hookType,
m_filterFunc,
IntPtr.Zero,
0
//(int) AppDomain.GetCurrentThreadId()
};
}
When the 4th param is setting to AppDomain.GetCurrentThreadId,the hook does work.
While it is setting to 0(article says global),the hook doesnt work.
What is wrong ?
|
|
|
|
|
Which hook are you trying to implement? Not all hooks work in the global context.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Nome
|
|
|
|
|
the hook in the VNCHook.dll is a global one that means every changed message in the desktop will be hooked by the VNCHook.
this can help decide whether the desktop has been changed.
now the problem is how to use it ?
|
|
|
|
|
Well, the MSDN article isn't going to be any help because it knows nothing of the VNCHOOK.DLL. It's not from Microsoft, so their not going to tell you how it works.
The VNCHOOK.DLL was written by a bunch of guys at RealVNC.com. There are no forums on their site and the documentation is REALLY sparse. There is also NOTHING on the normal news groups about the .DLL, other than people trying to remove it from their systems...
If your not able to find a support group that knows specifically about the VNCHook, you're on your own. The guys who originally wrote this thing don't do support for individual users and developers, so...
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
All our (Crystal) reports are created using NT Authentication (integrated security). At run-time we want to switch to SQL Server Authentication.
We are using Crystal Reports for Visual Studio .NET 2003 and the database is always SQL Server.
I pasted our code below. This code works fine as long as the database is on the same (local) SQL Server. As soon as we specify another database server then the statement Table.TestConnectivity() always return false!
Can anyone help?
ConnectionInfo ConInfo = new ConnectionInfo();<br />
ConInfo.DatabaseName = "AA_DB40";<br />
ConInfo.ServerName = "MyDatabaseServer";<br />
ConInfo.UserID = "sa";<br />
ConInfo.Password = "secret";<br />
<br />
foreach (CrystalDecisions.CrystalReports.Engine.Table Table in ReportObject.Database.Tables)<br />
{<br />
TableLogOnInfo LogonInfo = Table.LogOnInfo;<br />
LogonInfo.ConnectionInfo=ConInfo;<br />
Table.ApplyLogOnInfo(LogonInfo);<br />
if (Table.TestConnectivity())<br />
{<br />
Table.Location = ConInfo.DatabaseName+".dbo."+Table.Name;<br />
}<br />
}<br />
<br />
crystalReportViewer1.ReportSource = ReportObject;
|
|
|
|
|
An exception type and message would be far more helpful. If one is being thrown, please reply with what it is.
One possibility depends on how ASP.NET runs and what user SQL Server runs as. If ASP.NET runs as the default local user ASPNET, it - by default - will have no access to the SQL Server (even though SQL Server authentication is used, certain security settings may not let an unauthenticated user access the remote machine). Without knowing more about the nature of the problem, however, it's hard to know. This idea is probably not the problem, though - just an idea.
On a side note, you should not store the password in your assembly. Either encrypt it to the registry or .config file (you can actually do both of these, where the encrypted text is read from the registry automatically using the machineKey defined in your application's .config or the machine.config, or a myriad of other ways - search CodeProject for more details). This literal text will be easy to view even using ildasm.exe from the .NET Framework SDK or several other disassemblers/decompilers.
You can obfuscate your code. Most will encrypt literal text, but those aren't too hard to get around. It's just a deterrent.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
hai there,
i have a base class and a derived class. A < B.
both classes have a method of same signature and same name.
if i call that method on my derived class the base class method will execute. what is the actual tecnical side behind this ?. if i want to execute the derived class method then what i want to do ?
What is the difference between multi level and multiple inheritance ?
how can i impliemnt multilevel inheritance in C#.
need detailed description. other wise show me some usefull links
Sreejith S S Nair
|
|
|
|
|
To achieve what you're saying, declare the method on the base class as 'virtual' and the method on the derived class as 'override'.
Due to technical difficulties my previous signature, "I see dumb people" will be off until further notice. Too many people were thinking I was talking about them...
|
|
|
|
|
hi,
Answer to your first question :
class A
{
public virtual void Display()
{
// I'm in the base class
}
}
class B : A
{
public override void Display()
{
// I'm in the derived class
}
}
the notable thing in this piece of code is the use of the word "override". This example demonstrates the polymorphic behaviour. If "Display()" is called from an object of class B the overridden display of class B will be called. Where as if the same function is called from the object of class A then the base class Display will be called.
Internally this is done by maintaining a virtual pointer table. Whenever user tries to call the Disply method thru the derived class object the CLR looks at the VPTR table and determines which Display method to call and resolves the same...
Answer to your second Question :
Assume a class hierarchy :
Living_Organism
|
Mammal Insect
|
Boy Girl
Now in this heirarchy the class Boy is indirectly inherited from the top level class "Living_Organism" thus this is a multilevel inheritence.
But if you derive a class from two classes at the same time then it is called multiple inheritence. For example
class IceCream : Milk,Food
{
}
class IceCream demonstrates multiple inheritence because it is derived from more then one class (Milk and Food).
Note : Multiple inheritence is not allowed directly in C#. But you can simulate it upto some extent by inheriting a class from another class and an interface.
class Test : Name ,IAge
{
}
the class Test is derived from a class "Name" and an interface "IAge".
You can know more about all these from the following link...
http://www.windowsitlibrary.com/Content/1040/05/1.html
Hope this answers your query...
regards,
Aryadip.
Cheers !! and have a Funky day !!
|
|
|
|
|
Hi Guys,
I have data retrieved from diff ports using sockect connections. I got all the data inserted into SQL server database. I need to display the information exactly the same it was saved from my DB using datagrid. It was OK, it was display the data. What I need is if there is an ascii value like for example "Next Line" between each sentence the following sentence will should be displayed on the next like. What is happening now is that it's just display the data with one continuous line.
Ideas or link will do but if you could help the better. Please....
/dabuskol
|
|
|
|
|
You'll need to derive your own DataGridColumnStyle to acheive this. While the DataGridTextBoxColumn does use a TextBox internally to edit data (and you can set properties to make happen what you want), the text is painted as is. You need to change the painting so that certain characters are painted a certain way or induce line changes, like a CR or LR (or a CRLF pair).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
hai there,
Sreejith S S Nair
|
|
|
|
|
Dear Sir/Madam,
I'am trying to rotate an image in a picture box control in C#.Along with that i'am drawing a rectangle on to the image for highlighting certain parts of the image.While rotating the image is getting rotated properly but the drawing which i have made on the image is not getting rotated.I have tried with rotate and rotateat methods but they just rotate the drawing but not with respect to the image.
My requirement is that while i'am rotating the image, the drawn rectangle highlighting certain parts also should get rotated and highlight the very same area in the rotated form.
Kindly help me,
Regards,
mmx
|
|
|
|
|
|
Drawing on the image is not the issue...That is done using the graphics object only...But while the image is rotated the drawings position is not changed or rotated.It lies in the same place...while image is rotated...
Also while creating graphics from image an exception is popping 'coz it is saying "creating graphics object from image that has indexed pixel format is not possible "
I need some mapping modes equivalent to MM_HIENGLISH,MM_HIMETRIC in VC++ in C#.NET...Also help me a bit with code...
Kindly help me out Barry...
Regards,
MMX
|
|
|
|
|
A quick search for "image rotation" on CodeProject turns up several articles, including a pretty good one, Image Rotation in .NET[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I am faced with a problem and dont know where to begin. I am required to write a bot (automated program) in C# (preferably). Right now we have a website where a user has to enter some information and depending upon the options selected, a number representing that particular client with the options selected is generated and given back.
This website is working perfectly fine. But now what we want to do is instead of entering all the inforamtion again and again everytime we want to generate that number, we want to automate it. That is, write a class which will get the inforamtion from the database and accesses the already existing website, provide it with all the information and get the number generated.
The details of the existing website are as follows:
1. It is a form based website.
2. It has two web pages. i.e., on the fist page after entering the information and submitting it, the next page comes up and after entering the information on this one and submitting it will generate the required number.
3. Both these pages are passwrord protected. i.e., have to provide a user name and password before accessing them.
I am really confused how to begin and where to begin. I am not even sure if something like this can be done? Any help would be greatly appreciated.
Thanks in advance
Kashif
|
|
|
|
|
Filling the web page with information is pointless - just post the data yourself using a HttpWebRequest and using the GetRequestStream method, which - if you look at the documentation for that method in the .NET Framework SDK - includes an example. You can also use the WebClient.UploadData for this, but you don't have quit as much control over the HTTP headers that are sent.
As far as pulling information from a database, that's easy. Use ADO.NET. See the System.Data namespace in the .NET Framework SDK, and use whichever child namespaces (like System.Data.SqlClient for SQL Server or System.Data.OleDb for any data source with an OLE DB provider). There is plenty of examples in the class library documentation for members of those namespaces and you can always ask this forum if you have specific questions.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi Mr.Heath Stewart
I use the way that you describe for me .
this way only safe for graphic based on Win App.
but when i use from that file generated in web, black color appear in background.
i will make transparent background area (alpha channel)
if you know how i can resolve this problem , please describe for me .
thank's
---------------
Bitmap b = new Bitmap(100,20);<br />
Graphics g = Graphics.FromImage(b);<br />
g.Clear(Color.Orange);<br />
g.DrawString("Test",new Font("Tahoma",8),new SolidBrush(Color.Green),0,0);<br />
b.MakeTransparent(Color.Orange);<br />
b.Save("test.gif",System.Drawing.Imaging.ImageFormat.Gif);<br />
|
|
|
|
|
There is a bug in the .NET Framework when it comes to transparency. Head over to dotnet247 for lots of info on this plus some complicated workarounds.
regards,
Paul Watson
Bluegrass
South Africa
Chris Maunder wrote:
"I'd rather cover myself in honey and lie on an ant's nest than commit myself to it publicly."
Jon Sagara replied:
"I think we've all been in that situation before."
Crikey! ain't life grand?
|
|
|
|
|
ON top of that, .GIF files don't support an alpha channel. Just a transparency key...
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Nome
|
|
|
|
|
...which is what I told him.
Microsoft MVP, Visual C#
My Articles
|
|
|
|