|
i have written the following code to databind a pictureBox control to Northwind database(Employees table.But the photos looks hazy(not distinct). Any idea to solve this issue?
----------------------------
string connString = @"Data Source=localhost\SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=True";
string data = "Select * from Employees";
SqlConnection conn = new SqlConnection(connString);
SqlDataAdapter da = new SqlDataAdapter(data, conn);
DataSet ds = new DataSet();
da.Fill(ds, "Employees");
pictureBox1.DataBindings.Add("EditValue", ds, "Employees.Photo");
dataNavigator1.DataMember = "Employees";
dataNavigator1.DataSource = ds;
-----------------------------
I can navigate through the images and can see the safe-mode like quality of the images. Can anybody solve this issue?
thanaks
|
|
|
|
|
Hi all,
I'm kinda new in image processing. I now need to convert a 32bit depth image to 24bit depth image in order for a function to work which I got from AForge.Net API off Google. It only works on 24bit depth image, can I know if there's anyway I can convert a 32bits depth image I've got like 3 days left and I've researched online for samples but I can't seem to get anything to work. Thanks in advance! ^^
|
|
|
|
|
Have you tried FreeImage?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
32 and 24 bit are EXACTLY the same. Just create a new image at 24 bit, same size, create a Graphics object from that image, and then use DrawImageUnscaled to draw your 32 bit image into the graphics object ( thus converting it to 24 bit on the bitmap you created )
My image processing articles should give a good start to converting the long way, but what I just said is the easy way.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I'm trying to make a function which returns a type-value that can be specified by the user, or determined by the type of object passed through it.
For example:
public (T) function(this (T) input)
{
}
where the user can specify what type of control is being passed through the function, and so the function will return a control of that type. Otherwise, perhaps where the function *determines* the type of control input is (ie, typeof) and returns of that type.
Is it possible? Thanks.
|
|
|
|
|
Epoque wrote: Is it possible?
Yes, it is. It's called Generics.
|
|
|
|
|
I use this function to convert an integer value to a suitable enum ordinal. It tries to find a valid ordinal based on the specified integer parameter. If it can't find one, it returns the specified default value.
enum MyEnum { None=0, Few=1, Some=2, Many=4, CrapLoad=8, All=128};
public static T IntToEnum < t > (int value, T defaultValue)
{
T enumValue = (Enum.IsDefined(typeof(T), value)) ? (T)(object)value : defaultValue;
return enumValue;
}
int x = 3;
MyEnum myEnum = IntToEnum < MyEnum > (x, MyEnum.All);
x = 4;
myEnum = IntToEnum < MyEnum > (x, MyEnum.All);
Is this a sufficient example?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
That's fantastic. Completely didn't know the T argument specified in <> after the function name would work as the defined type for return.
Thanks a lot
|
|
|
|
|
Hi,
I have a form and 2 user controls A and B. When the form is loaded initially, I dock A. When a certain button is clicked I detach A and dock B to the form (A is not destroyed at this point). What is the best way to do this?
----------------------------------------------------------
"unzip; strip; touch; finger; mount; fsck; more; yes; unmount; sleep" - my daily unix command list
|
|
|
|
|
let the form handle the button click event and dock/hide what it needs to.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hello everyone,
If my ASP.Net page returns both response Http headers and redirection to client's Http request, my question is when client follows the redirection instruction to access the redirection destination URL, will the client automatically include the response Http headers into the further Http request headers to follow-up redirection or not? Is it a standard to follow to include the previous Http response headers to redirection Http request headers by client or optional?
(my current confusion is I want client to redirect to some other URL and also include current Http response headers to the redirection URL request headers, but I am not sure whether all clients could follow this way.)
BTW: clients I mean browsers.
thanks in advance,
George
|
|
|
|
|
George_George wrote: If my ASP.Net page returns both response Http headers and redirection to client's Http request, my question is when client follows the redirection instruction to access the redirection destination URL, will the client automatically include the response Http headers into the further Http request headers to follow-up redirection or not?
Install Fiddler and monitor the request. It can be downloaded here[^]
BTW, Cp has an ASP.NET forum and this question should belong there.
|
|
|
|
|
Thanks Navaneeth,
Actually I am already using Fiddler. My concern is I want to know whether it is standard or not. Since I can only test with my own environment with IE8, and I am not sure whether my web application could be compatible with other browser clients.
Any comments whether it is standard?
regards,
George
|
|
|
|
|
We have an ASP.NET forum, you know. you seem to ask a lot of questions where you could just do some testing to find the answer.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Thanks for recommendation, Christian!
I will ask there.
regards,
George
|
|
|
|
|
|
What is "totalbytes"? There is no element or attribute with that name.
|
|
|
|
|
I have a form with a datagrid. In the server explorer pane, I dragged a stored procedure to the form. How do I make the stored procedure the datasource of the datagrid? Also, if that's possible to do, I would like to be able to select only a subset of the resulting columns from the stored procedure. Domo Arigato'
----------------------------------------------------------
"unzip; strip; touch; finger; mount; fsck; more; yes; unmount; sleep" - my daily unix command list
|
|
|
|
|
I've found it, one needs to add the storedproc to the dataset. once it's added, it will be available as one of the datagrid's datasource.
----------------------------------------------------------
"unzip; strip; touch; finger; mount; fsck; more; yes; unmount; sleep" - my daily unix command list
|
|
|
|
|
hi friend's
i have a server. and i set up 5 ip address on it. i write an application software that run on the server and need use of all 5 ip's address at a priod of time, it means i need to switch between this adresses at a priod of time automatically?
please give me a asolution...
thank you
nobody help you...
you have to help you yourself
and this is success way.
|
|
|
|
|
mr.mohsen wrote: i have a server.
What type database, web, services.
If it is a database server then just change the connectionstring and use the IP rather than the server name!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I am brushing up on C# 3.5 and came across something odd to me. I know that deliberate fall throughs are legal in c/c++ but not in C#. C# however added a GoTo(case) to get around that.
I just noticed that when you use the GoTo method though, the condition for that case is not checked, it simply accepts it and process the code in that case. I tested this with strings and int's.
What I want to know, am I correct in saying that conditions are not checked when using the goto statement, and is this a new feature in 3.5. I never worked with C# outside of ASP so rarly if at all used switch.
|
|
|
|
|
Goto is an unconditional jump to a label so the switch condition is not evaluated, just the jump is executed.
If I remember correctly, goto keyword is defined in the earliest C# specification so it's not new in C# 3.0.
Although it makes jumping easy, I would try to avoid using goto statements since they make reading the code harder and more vulnerable to logic errors.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Thank you.
I don't intend on using it but it struck me as weird when a string happned to be passed without having to be checked.
|
|
|
|
|
IMHO, if you have to use a Goto, you really need to rethink your logic. I haven't touched a Goto since I stopped using VB6, back in the .NET 1.0 Beta days.
|
|
|
|