|
I want to convert a color bitmap to black an white. I attempted to create a graphics object from an image with 1 bit per pixel color depth, and then used graphics.drawimage(image iColorImage) to draw the color image onto the b/w graphics object. This results in an out of memory error. Does anyone have a snippet of code that does this?
Thanks
|
|
|
|
|
Joe, if you're talking about going from Color to GreyScale, I have a bit of code that does exactly that. Drop me an email if you'd like it.
|
|
|
|
|
Hello,
In my usercontrol I have a Image defined. In the property window at
design time I get the image editor without doing anything. However, it
is just a little different compared to the image editor used by the base
properties like BackgroundImage. If you have assigned a bitmap to the
property but want to remove it, you get a RESET menucommand if you go
over to the BackgroundImage property. However, my property does not have
the RESET command and thereby it is not possible to remove the picture
from the property.
What should I do???
stefan@devosoft.com
|
|
|
|
|
Hi everyone,
I was wondering if anyone's worked with the WebBrowser control and the MSHTML library using element events. I'm trying to hook an HTMLElement onclick event after a document page loads but I can't seem to figure out what c# expects us to do.
I tried this to no avail along with a couple of other approaches
using MSHTML;
class
{
...
protected IHTMLElement elem;
protected bool OnHtmlElementClick(IHTMLEventObj sender)
{
MessageBox.Show("Got it!!");
return true;
}
webcontrol_NavigateComplete2()
{
elem = GetElementFromDocument();
elem.onclick =
new HTMLElementEvents2_onclickEventHandler(this.OnHtmlElementClick);
elem.click(); // force a test
}
}
Steve A
B.Eng, MCSD, MCSE, MCDBA
Senior Software Developer
Optimal Robotics Corporation
|
|
|
|
|
Hi ,
do you have the answer ??
|
|
|
|
|
Sorry for the cross post but I cant get much of a response from the C# forums that I know about. Heres the copy and paste from the codeguru forum:
Has anybody seen an example of this or any of the other C# encryption classes? The documentation seems to assume you are familiar with the topics and never lists an example.
Basically I'm looking for an algorithm that will generate a key based on a password and user id. It doesnt have to be the best security but I would rather use a built in algorithm rather than constructing my own.
TIA
|
|
|
|
|
i want to get file information such as it's icon,size,path etc.
i don't how to get the icon information,i think should use
import shell32.dll to do it,because there is a SHGetFileInfo
Function which can Get the file's Icon Information,but I don't
know how to invoke it,if you could do it,please don't hesitate
to help me,thanks
i need an example code of how to use SHGetFileInfo in c#,thanks
|
|
|
|
|
Hi,
I'm trying to write something like a "pipe" function for some streaming code I'm writing. What I want to write is a function that can "preview" a stream, making a new one if necessary. It'll have to return the same type as it takes. e.g. for a function:
bool Something( StreamReader r ) { ... }
I could call it as either:
Something( r );
Or (using the pipe command )
Something( CountStream( r ) );
I've written the following, but get an exception whilst trying to new up the "output" stream:
private static System.IO.Stream CountStream( System.IO.Stream r )
{
// Following give compile error
// System.IO.Stream w = new System.IO.Stream(r);
// Following give runtime error (and isn't exactly what I want)
System.IO.StreamReader w = new System.IO.StreamReader(r);
int nByte = r.ReadByte();
while ( nByte != -1 )
{
m_nCount++;
nByte = r.ReadByte();
}
return w.BaseStream;
}
I'm using "System.IO.Stream" since it forms the base class, ideally I'd like to be able to pass in any "System.IO.Stream" type.
Am I chasing up the wrong alley?
Regards,
Ray
|
|
|
|
|
I am programming in ASP.NET and C#. I was trying to retrieve the event log information from a remote machine in my code using the EventLog class from .NET Framework. It throws an Unauthorized access exception when I try to get event log information of any remote computer. Though, I am able to access these event logs through Event Viewer. I was researching on the web and I read that I need registry rights to that remote machine. Does anyone know about this or has anyone tried this before?
|
|
|
|
|
I'm working on a project now that does that and I'm able to do it. The domain account I'm using to access the remote computer is a member of the Administrator group on the remote machine. I don't know what registry rights are but I assume Admin rights cover that.
Maybe you have some kind of read-only rights to the remote registry? I haven't seen this problem before so I don't know what would cause it.
Craig Dodge
A catchy signature should appear here.
|
|
|
|
|
But, you didn't wrote, how you achieve your work...
Thanks,
Chintan(India)
|
|
|
|
|
Hi,
on my textBox1_KeyUp event i only want to accept numeric keys, i.e., i'll only accept 0,1,2,...9. Letters and others keys will not be accepted.
Example: supose tha i wrote 123asd
i want that
textBox1.Text = 123 instead of textBox1.Text = 123asd.
My problem is that i can't do e.KeyValue = 0 ,because e.KeyValues is readonly. To e.KeyCode and e.KeyData it's the same.
Anyone knows how to solve this problem??
Thanks
Carlos Lopes
|
|
|
|
|
Is it possble to instantiate a COM object written in C# from a standard MFC app written in VC6?
ps I have only been C# for 1 day - and I have managed to implement a plugin interface that I use for VB and ATL objects and I was investigating whether we could also use C# et al
Holy Handgrenade of Antioch instructions
|
|
|
|
|
Hi CodeProject,
I have created a form with a datagrid, my requirement is that when
the user clicks "F5" I want to update a certain column with the current
time.
I defined a DataGridTableStyle and a DataGridTextBoxColumn object. I
attached an event handler to the DataGridTextBoxColumn.TextBox.KeyUp
property.
So now when I hit "F5" the column is updated, but alas, as soon as I
navigate to a different line, the row disappears! Am I doing something
wrong, or is this a bug? Maybe someone has an different way of doing this?
Anyways, this is my code for the KeyUp event:
private void dataGridColumn1_TextBox_KeyUp(object sender, KeyEventArgs kea)
{
if (kea.KeyCode == Keys.F5)
{
DataRowView drv = (DataRowView)dataGrid1.BindingContext
[dataGrid1.DataSource].Current;
drv["Col1"] = DateTime.Now.ToLongTimeString();
}
}
Thanks
|
|
|
|
|
Do you know where can I get a source code of any proxy server, working under Windows writen in C/C++??? I need it so!!! Thanks in advance.
|
|
|
|
|
System.winforms isn't there. I can access forms through System.Windows.Forms.Form but all the books I read and examples I see are using Winforms??? Is there something I am missing?
MS all the way!
|
|
|
|
|
System.winforms was renamed to System.Windows.Forms in Beta 2
Some of the examples haven't caught up yet...
|
|
|
|
|
Thanks...Does anyone know of a good reference online for the classes and what is in them?
|
|
|
|
|
Hi, i've got a little problem when trying to change a datarow caption property.
Lets say that i've :
- one DataTable named dTable;
- the DataTable as 4 DataColumns;
- supose that dTable.Columns[0].ColumnName="CodTerc"
and i do:
dTable.Columns[0].Caption = "Código";
After doing this i expected that my Grid has the first column caption = "Código", but unexpectedly the caption ="CodTerC".
I know that by default datarow caption= datarow columnName, but when i change caption i expect that my grid shows the caption not the ColumnName.
If someone has an answer for this please say something.
Thanks
Carlos Lopes
|
|
|
|
|
does anyone have example of fsream code?
|
|
|
|
|
I have written a C# component that I use in ASP and in ASP I use a
recordset which I would like to give to along as a parameter with a method
from my C# component. How do I handle this ? How can I read that recordset
and what type of variable or object must the parameter be of my c# method.
Any one ?
Thanks
Thomas
|
|
|
|
|
|
Hi, i've got a little problem when trying to change a datarow caption property.
Lets say that i've :
- one DataTable named dTable;
- the DataTable as 4 DataColumns;
- supose that dTable.Columns[0].ColumnName="CodTerc"
and i do:
dTable.Columns[0].Caption = "Código";
After doing this i expected that my Grid has the first column caption = "Código", but unexpectedly the caption ="CodTerC".
I know that by default datarow caption= datarow columnName, but when i change caption i expect that my grid shows the caption not the ColumnName.
If someone has an answer for this please say something.
Thanks
Carlos Lopes
|
|
|
|
|
I'm currently working on a project which has a registry representation in a treeview in which the user is able to write a path to a key (ex: HKEY_CURRENT_CONFIG\Software) and I'd like to select that registry key based on this string. Is there any way to do this?
Andreas Philipson
|
|
|
|
|
Hi, someone knows how can i do so RETURN key acts like TAB key????
I want that if the user presses return key then the application puts the focus on the next component.
Thanks
Carlos Lopes
Carlos Lopes
|
|
|
|