|
Dunno, I've never used DataSet.WriteXml; for that matter, I rarely use a DataSet.
I suggest using an XmlDocument or XmlTextWriter to create XML files.
What I generally do for nulls is have an IsNull attribute that I can set:
<SomeValue IsNull="false" >blah</SomeValue>
<SomeValue IsNull="false" />
<SomeValue IsNull="true" />
|
|
|
|
|
Hello all,
i have the requirement to Extract data from image. can u plz help me out with the code.
I am strugling to extract data from image file using C# (.net 2.0)
For Ex: I have an image with a number.. I need process the image and extract the number and store it in sql DB.
Please help me for this implementation using C#.
Thanks
|
|
|
|
|
What kind of extraction are you talking about?
If it's simply a number presented as an image, google for OCR libraries. If the data is hidden in your images, google for steganography. Also, Corinna John has an excellent set of articles on the latter, here at CodeProject.
Cheers,
Vıkram.
I've never ever worked anywhere where there has not been someone who given the choice I would not work with again. It's a job, you do your work, put up with the people you don't like, accept there are probably people there that don't like you a lot, and look forward to the weekends.
- Josh Gray.
|
|
|
|
|
|
I need to extract the text from image file. The image file may contain text embedded with the image.
|
|
|
|
|
Did you actually read the post you just replied to? He told you what you need to do, and even posted useful links!
|
|
|
|
|
i want to change the background color of an image in that way that only visible part get new background color, is there any in built function for this ? well, i tried with this but i dont know what to do next
Bitmap bmp = new Bitmap("C:\abc.png");
for (int x = 0; x < bmp.Width; x++)
{
for (int y = 0; y < bmp.Height; y++)
{
Color tmp_oldColor = bmp.GetPixel(x, y);
if (tmp_oldColor != Color.Transparent)
{
Color tmp_newColor = ??;
tmp_newColor.A = tmp_oldColor.A;
bmp.SetPixel(x, y, tmp_newColor);
}
}
}
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
As you are not using the transparency to determine background color, what do you want the background color to be?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
hmmm....my mistake, i wrote "change". The actual thing is that the image is transparent, like vista glass and but have some shapes on it those are tranparent too and i want to set its backcolor, like green, blue or any. That my question.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Ok, create a new bitmap with the same size, create a graphics object for it using Graphics.FromImage, fill the image with the background image using the Clear method and draw your image on it using the DrawImage method.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
No, you misunderstood, here is some example
Transparent Image
Added Red Back Color
now see the last image, i added color red but i just want color back to the image, not in entire image
i can do something nearly, Fill a rectangle with Red color, draw image then use MakeTransparent(Color.Red) but it wont do exactly what i want, it will not set alpha. My image wont be transparent anymore.
the otherway i can use is : (just wrote directly, not tested)
Bitmap bmp = new Bitmap(ofd.FileName);
Bitmap bmp_backColor = new Bitmap(bmp.Width, bmp.Height);
for (int x = 0; x < bmp.Width; x++)
{
for (int y = 0; y < bmp.Height; y++)
{
Color tmp_oldColor = bmp.GetPixel(x, y);
if (tmp_oldColor != Color.Transparent)
{
Color tmp_newColor = Color.FromArgb(tmp_oldColor.A, 255, 0, 0);
bmp_backColor.SetPixel(x, y, tmp_newColor);
}
}
}
Graphics m_gr = Graphics.FromImage(bmp_backColor);
m_gr.DrawImage(bmp, 0, 0, bmp.Width, bmp.Height);
m_gr.Dispose();
pictureBox1.BackgroundImage = bmp_backColor;
Is this way right ?
Modified :
I updated the code with working one,
The Working Output
My question, is that the only way or is that way good ?
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
modified on Tuesday, January 27, 2009 4:21 AM
|
|
|
|
|
Xmen wrote: Color tmp_newColor = ??; // how to get new color ? Multiply, Add ?
Color tmp_newColor = Color.Green;
or Color.FromArgb(....)
or Color.FromName(...)
or Color.FromKnownName(...)
choose whatever...
HTH
[Modified]
one more thing, you are using GetPixel and SetPixel which are extremely slow. try using LockBits() and UnlockBits() for speed.
[/Modified]
regards
|
|
|
|
|
PandemoniumPasha wrote: Color tmp_newColor = Color.Green;or Color.FromArgb(....)or Color.FromName(...)or Color.FromKnownName(...)choose whatever...
this is not that simple, i have to calculate the RGB values for new color.
PandemoniumPasha wrote: one more thing, you are using GetPixel and SetPixel which are extremely slow. try using LockBits() and UnlockBits() for speed.
thanks for the info
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hello all.
I'm working on a portion of a program I'm writing that involves creating new rows in a table that has no primary key and two foreign keys. The rows in the datatable are invoice details for rented items. I want to be able to get this new row and place it's contents in a listbox, followed up by a number of similar new rows in the same listbox.
I'm not sure how (if it's possible,) to retrieve the new row since it has no primary key. I'm also not sure then how to associate the datarow with it's respective item in the listbox.
My hope is to be able to, when necessary, select the item in the listbox and use it to delete the row it's associated with from the datatable.
I'm going out on a limb here hoping someone might have some advice or can point me in the right direction. Any help would be hugely appreciated. Thanks in advance!
|
|
|
|
|
Lodeclaw wrote: I'm writing that involves creating new rows in a table that has no primary key and two foreign keys
Isn't there any natural key present? Also could you create a key column in your datatable and let the datatable to generate a unique value to it?
Lodeclaw wrote: followed up by a number of similar new rows in the same listbox
How do you recognize similarity?
Lodeclaw wrote: I'm also not sure then how to associate the datarow with it's respective item in the listbox
If I understood correctly your problem in this, you would use ValueMember[^] definition in your binding.
Lodeclaw wrote: use it to delete the row it's associated with from the datatable
When the listbox is binded to the datatable, you would actually delete the row from the datatable. The listbox reflects the changes in your datatable.
|
|
|
|
|
Hi friends
How switch on computer in C# codes with any key which ı set key. ı am sorry about I speak a bit English
|
|
|
|
|
Wow, that's a fantastic question
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Because .NET needs to be on and running in the Windows environment BEFORE any program can be run. It is not possible to turn on computer based on any key. It is, however, possible (don't ask me how) to remotely turn on a computer with some BIOS "Wake on LAN" setting. I have no clue how this would be set through C# programming though.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
Thomas Stockwell wrote: I have no clue how this would be set through C# programming though.
FYI : UDP broadcast apparently does it - with the 'magic packet' as described in the link to my reply to him, so that's doable from C#. You're correct of course, in that you need to turn the computer in question on from another computer, already running
'g'
|
|
|
|
|
eMOx wrote: with any key which ı set key
not sure what you mean there .. the best option I know of is 'WakeOnLAN' in which particular 'Magic' Packet is sent to the network card, targeted by its MAC Address - this presumes the network card, hardware etc support it.. more info here http://en.wikipedia.org/wiki/Wake-on-LAN[^]
'g'
|
|
|
|
|
Most BIOSes seem to let you pick a key which works for power-on (or even a power-on password in some cases). Setting this from C# is likely horrible. Chances are this question would be best asked in the MFC forum for some lower level dudes to answer (and by lower level I mean closer to metal ).
Odd on you'll be raising some strange interrupt with a pointer to a block of custom crud somewhere, and it'll be all motherboard specific. Would be about as much fun as writing your own BIOS flashing utility for fun :P
|
|
|
|
|
Are you sure you mean switch on? Off would make a bit more sense.
Cheers,
Drew.
|
|
|
|
|
I assumed the post was a joke response to the earlier power off question.
|
|
|
|
|
Ah, didn't see that. Thought I'd spend a few minutes forum cruising.
Cheers,
Drew.
|
|
|
|
|
Hi all,
First of all, thanks to everybody who offered much needed advice for getting the server set up on my home machine. My program can interface with the server and do some basic operations, which is exactly what was needed.
Second, sorry if this is considered a repost--I posted earlier today about this but didn't get a response. Didn't know if CP sends notifications to everybody in the thread if anything at all is added to the thread, hence why I'm posting here.
My question is pretty simple. I'm trying to log onto the server with a laptop using a username/password combo. What I end up with is, "Login failed for user (this computer)/Guest", where "this computer" is the computer hosting the server.
I've read articles about how to fix this, and most focus on creating a login the server knows about, and using Mixed mode for remote access. But everything I've tried results in that same error message.
How do I make this work? Server machine is WinXP Pro, remote machine is Vista.
Thanks for any advice,
Michael Fritzius
P.S. Actually the next part after this will be to log into the server via the internet, using an IP address. Any tips on that would be appreciated too, so I don't have to make yet another post
|
|
|
|
|