|
Hi,
I really like that article for performance so from that i had implemented Grayscale in 1 second but now contrasting function is taking 4 seconds so whole color filter takes 5 seconds.
so do you have any clue or idea?how to improve that?
|
|
|
|
|
Hi!
How about adding your contrast calculation in the loop where you're grayscaling the image?
That way you don't have to iterate over all the pixels twice.
Something like this:
PixelData* pPixel = PixelAt(0, y);
for (int x = 0; x < size.X; x++)
{
byte value =
(byte) ((pPixel->red + pPixel->green + pPixel->blue) / 3);
value = (value < threshold) ? byte.MinValue : byte.MaxValue;
pPixel->red = value;
pPixel->green = value;
pPixel->blue = value;
pPixel++;
}
mav
|
|
|
|
|
Hi,
I Have A parent window in that by pressing a HOTKEY A window(navigating window) opens By Pressing the Link in the Hotkey window it navigates to another page.My Question is If I defaultly closing The Parent window(i.e main window) The hotkey window(navigating) also must Be closed
Prabhakar.A
Software Engineer
|
|
|
|
|
Hi!
Why not just call the navigation window's Close() method in the Closing event handler of your main window?
mav
|
|
|
|
|
yea it will be closed
ByMindOnlyYouCanDoIt
|
|
|
|
|
hi all,
I am using two axwebbrowsers in a form and am populating those with htms. I want to add synchronised scrolling(horizontal and vertical) to these browser controls. Can anyone help me here?
PS: i am totally new to C#, so please be generous in explanation...
Thanks in advance
Pai
|
|
|
|
|
hello;
i've recently re-did my website from the ground up in asp.net technology. im still new to it all, because im use to the old linux servers using php.
basically what im trying to do, is set up a paging system on a datalist. the data is loaded from an xml file to a dataset. i found tutorials online on how to do pagination but it all uses sql databases and the paging is different since im loading xml into a dataset.
im also writing this in c#.
here is a link to the pages im trying to paginate: http://www.jt-fx.com/debauchery/photoalbum.aspx?imgID=2005/03
any help would be appreciated
thanks,
jt
|
|
|
|
|
i forgot, here is the code-behind that loads the pictures:
private void Page_Load(object sender, System.EventArgs e) {
if(!Page.IsPostBack) {
BuildGrid();
}
}
public void BuildGrid() {
string path = null;
if (Request.QueryString["imgID"] != null) {
path = Server.MapPath("~/images/photoalbum/") + Request.QueryString["imgID"] + "/images.xml";
FileInfo fi = new FileInfo(path);
if (fi.Exists) {
XmlDocument doc = new XmlDocument();
DataSet ds = new DataSet();
ds.ReadXml(path);
dlImages.DataSource = ds;
dlImages.DataBind();
} else {
lblError.Visible = true;
}
}
}
|
|
|
|
|
Hello dear all
i m working in C# windows based application i have a one problem i have selected many row in datagrid ho can i find the selected row index number of data grid please help me......
Priyank Gupta
|
|
|
|
|
try this : datagrid.SelectedIndex
The future will not remember;
The past does not forget!
|
|
|
|
|
this is not a property of datagrid;
|
|
|
|
|
Have a look at the DataGrid.IsSelected property.
This will tell you whether a row is selected or not. You will have to loop through all rows to find those that are selected.
|
|
|
|
|
yes your are right now i have implemented by this property but in my grid there is thousands record in grid then if i will search by loop then it will take more time
do you have nay other feature for searching selected row in data grid
please help me
tahnks for reply
Priyank Gupta
|
|
|
|
|
Sorry, but as far as I know there is no other way. If you should find one then tell me
|
|
|
|
|
there is a way to find the row index number of a selected row, but as far as i know it can only return you one row index, so even if 6 rows are selected you wil only get one row index
the way to do this is:
dataGrid.CurrentCell.RowNumber;
|
|
|
|
|
Hi,
I'm trying to send an image from a C# WinForm app to a PHP page in binary format.
All PHP is taken care of, and security is of no concern.
My problem is that I'm not sure how the correct way to post the info is..
So far, I've got:
///////////Code Starts...
string myUrl=/*myURLhere*/;
string result ="";
FileStream fs = new FileStream(@"c:\image.jpg", FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(fs);
Byte[] buffer = br.ReadBytes((int)fs.Length);
HttpWebRequest wr = (HttpWebRequest)WebRequest.Create(myUrl);
wr.Method= "POST";
wr.ContentType = "application/x-www-form-urlencoded";
wr.ContentLength = buffer.Length + 8; //For the variable header "myImage=" in POST
StreamWriter sw = new StreamWriter(wr.GetRequestStream());
sw.Write("myImage=" + buffer);
sw.Close();
HttpWebResponse webResponse = (HttpWebResponse)wr.GetResponse();
Stream s = webResponse.GetResponseStream();
StreamReader sr = new StreamReader(s);
result = sr.ReadToEnd();
/////////////End Code
The debugger stops at the line
HttpWebResponse webResponse = (HttpWebResponse)wr.GetResponse();
With error:
Additional information: The request was aborted: The request was canceled.
Any suggestions?
Many thanks to anyone who can help out.
Timbo
|
|
|
|
|
hiii,
how can i get processes handles which work on file.
i mean, if a process opend a file and works with it; how can i know it's handle from the opend file.
thanx for your time.
marcoryos
|
|
|
|
|
Greetings,
Question: When one news an object (class) eg:
MyClass myClass = new MyClass();
Are only the fields (class level variables that aren't in any method) getting newly allocated memory to store them, or are all the methods (functions) getting memory allocated for them as well?
I understand that variables in the scope of methods do get allocated when the method is called then removed when the method returns but what about the code of the method... where does it live? And does it get replicated on each new?
Here is another way to ask it... If I have 1000 newed instances of MyClass in an array and inside of MyClass I have 25 methods that have a lot of code in them. Do I now have 1000 copies of those method's code in memory too?
I think what would help is if I knew where the code itself lives in memory... and, whether or not there is only one copy of it in memory even if you create multiple pointers to it with new.
Please set me straight... any help will be greatly appreciated.
EB
|
|
|
|
|
You need to differentiate between code and data. Code is loaded only once (per appdomain, if the assembly is not domain neutral) when the assembly containing the type is loaded into memory. That includes code for methods. Along with code, static data is also loaded only once. It makes sense because code is not going to change every time you create an object.
When you instantiate an object (assuming it is a reference type), memory is allocated for all member variables. If the member is a value type, then memory allocated is equal to the size of the type. If the member is a reference type, unless you've instantiated it in the constructor, memory is allocated only to hold a reference, ie, 4 bytes in 32 bit machines.
What you said about variables in scope of methods holds true only for value types (structs, enums..). For reference types, memory remains allocated till all references to it are lost.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Well, you've done it again Senthil. Many thanks!
I'm just not clear on what you mean by this:
For reference types, memory remains allocated till all references to it are lost.
What is ment by "all references to it are lost"? Do you mean till all references to it fall out of scope? Or does one have to explicitly set it to null?
EB
|
|
|
|
|
Hello everyone,
Does anyone know how to open and read the fields of an access database using csharp?If any one does know,please send me the couple of lines that will allow me to do so
Thank you
Gijoe Bijoe
|
|
|
|
|
Search for ADO.NET on MSDN or codeproject. You can talk to databases using the System.Data namespace. Create a connection, command, then execute it. Pretty straightforward.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: He has a funny face. And he's my son.
Judah Himango
|
|
|
|
|
GIven Below is sample code to access 'Employee' table from Access Database named Mydb1.mdb
OleDbDataAdapter da = new OleDbDataAdapter(@"Select * from employee",
@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\mydb1.mdb;User Id=admin ; Password=;");
DataSet ds = new DataSet();
da.Fill(ds);
DataGrid1.DataSource = ds;
DataGrid1.DataBind();
Hope this helps
Ravindra Sadaphule
MCSD.NET
|
|
|
|
|
I have a very unusual problem:
I am using CSC.EXE to compile a small program with a background image on the main form.
CSC seems to compile the program successfully, but when I go to run the program, it gives me a Thread exception error. When I debug the application, this is what I get:
=================================================
An unhandled exception of type 'System.Resources.MissingManifestResourceException' occurred in mscorlib.dll
Additional information: Could not find any resources appropriate for the specified culture (or the neutral culture) in the given assembly. Make sure "Form1.resources" was correctly embedded or linked into assembly "Pax".
baseName: Form1 locationInfo: Pax.Form1 resource file name: Form1.resources assembly: Pax, Version=1.0.1899.20704, Culture=neutral, PublicKeyToken=null
=================================================
Now.. If I remove the background image from the form, the program compiles, and runs fine.
Using:
VS.Net 2003 Enterprise
Microsoft (R) Visual C# .NET Compiler version 7.10.6001.4
for Microsoft (R) .NET Framework version 1.1.4322
|
|
|
|
|
Hi Ray,
I tried to simulate the program and it works fine.
Can you please the send the code?
Cheers
Ravindra Sadaphule
MCSD.NET
|
|
|
|