|
Hi
you told the solution already
you have to create a user control of datagridview column type with the number textbox you created and make column type of No as the newly created datagridview column.A sample code for customized datagridview column type is available with in the msdn
If you can't just mail me
regards
shine.paravur@gmail.com
|
|
|
|
|
If i want to crop a rectangle of the used part of a bitmap, what is the easiest way to do it?
|
|
|
|
|
Just create a new bitmap, get the pixel from original bitmap and set the pixel to new bitmap using GetPixel and SetPixel.
|
|
|
|
|
But how can i know where are the empty pixels and where there are used pixel ?
For Example:
I will get in one of the iteration a Bitmap with 1000X1000 pixels but the DLL that i used only used 15X28 in location (523,724)
in the bitmap, How can i get a new Bitmap with the size of 15X28 that contain only the crop of location 523,724 ? (Every iteration will be with different size and with different location).
(In the next iteration i can get Bitmap with 500*500 , used size 123*243 and the location will be in 23*342 for eample)
Every time i will want a new Bitmap with only a crop of the used part of the old Bitmap.
How can i do it?
|
|
|
|
|
Hi,
the one way with decent performance goes like this:
- create a new bitmap with appropriate size;
- call CreateGraphics on it;
- perform Graphics.DrawImage using an overload that lets you choose part of a source image
- if necessary, save the bitmap in the format you like
- Dispose of the objects you no longer need.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
There is no source image, every time i will get Bitmap with another size and i want to cut the unused part, lets say that i will get Bitmap with the size 500X500 but there is only one small rectangle size 10X15 that locate in Point 124,254 in the orignal Bitmap and i want to get new Bitmap with the size 10X15 that contain the pixels from location Rectangle ( Location(124,254), Size(10X15)) but the only thing that i have is the bitmap.
If i had the Rectangle of the used parts of the bitmap ,for example, i could just Clone the bitmap with this Rectangle, but how can i get this Rectangle?
|
|
|
|
|
the image you have IS the source image, the bitmap you draw into is the destination image.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
I like you, you're such a nice, humble person.
|
|
|
|
|
If I understand correctly, your problem is locating the image you want to crop inside the bitmap.
You said that it will always be a rectangle, and you talk about "empty" and "full" or "used" and "unused" pixels.
This simplifies your problem a lot! You should be aware that image recognition is a rather complex field, and without these two assumptions you would have to go for complex solutions.
Now, if you know the characteristics of the "empty" or "unused" pixels, you can recognize them. Fox example, they might be all of the same color (white ? black ?). So, starting from the corners of the image you can detect the first "used" pixels and define your cropping rectangle.
How you do it is strongly dependant on the inner image characteristics. For example, if ALL of the inner image's pixels are different from the "unused" ones (different color, in my example), then you can walk along the diagonals of your bitmap to find the cropping area and then define it by walking along its edges if necessary, and so on.
Hope this gives you some ideas.
2+2=5 for very large amounts of 2
(always loved that one hehe!)
|
|
|
|
|
Hi,
I am working on a windows application in which I have to send a http url to a server which returns me the data which i have to enter to a hash table.
I am unable to create the http connection to the server.
Please help how can i write that method
url is smthing like in which i have to paas 2 parameters which returns me a string .
e.g.
http://202.87.50.140:6000/Services/asd.getprice?Item=$Item$&Code=$Code$
|
|
|
|
|
Hi,
do you get any exception/error when opening the connection? (If you just wanted to know how to build a httpconnection, use HttpWebRequest and HttpWebResponse).
Regards
Sebastian
|
|
|
|
|
Actually I don't know how to write code for that .. I am really new to this ..
|
|
|
|
|
|
WebClient LobjWebClient = new WebClient();
string LstrData = LobjWebClient.DownloadString("http://www.google.com");
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
what kind of exception did you get ?
|
|
|
|
|
i m very new to C#...just started working in C#.... i need to make a database like attendence record of a departmemt employees, in which only outhorized users can update the records...i need to make login interface n then database view of records....how can i do it in C#? how to connect to the data base...ialready have made tables of employee n there attendence in Microsoft Access, now how to connect it into C# n use it? plzzzzzzzzzzzzzz help me out.
thankx in advance....
|
|
|
|
|
|
|
Hey dude I might help u if u can work on SQL ..............
Here is some
using System.Data.SqlClient;
public SqlConnection con = null;
SqlDataAdapter da = new SqlDataAdapter();
If it is ok dig out more
|
|
|
|
|
what i advice you to do is to design your database scheme first of all
turn off the computer, write everthing down before you hit the keyboard
after you have your database scheme, take your time to build the database, i advice you to manage login in sql (create user table with id/user/pass and trigger a login store_procedure).
go to c# only after database is donne
- - -
About the connection to the database in the previous post you see a way to do that
You can find lots of stuff on google if you use key word like "c# database connection" but i advise you to download microsoft absolute beginners lessons videos, it´s free and you will understand it better
in alternative download a project here in codeproject
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
If I had an html page ( page source is given below), how to find the position of specific tag element on that html page.
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft FrontPage 5.0">
<TITLE></TITLE>
</HEAD>
<BODY>
<H1>Example Table</H1>
<P> </P>
<p> </p>
<p></p>
<p></p>
<hr>
<p></p><FORM ENCTYPE=multipart/form-data METHOD=post>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td width="13%"><b>abc</b></td>
<td width="44%"><INPUT NAME=Filename VALUE=textvalue.txt size="20"></INPUT></td>
<td width="13%"><b>xyz</b></td>
<td width="130%">
<INPUT TYPE=file NAME=Filedata size="20"></INPUT></td>
</tr>
</table>
<P><br></P>
<p></p></FORM>
</BODY>
</HTML>
I want get the position of <b> tag which is highlighted above.
How to get it?
I am using VS 2005 with the .NetFramework2.0
|
|
|
|
|
If you have this HTML as a string, you can use Regular Expressions to search for the tag. You can find the RegEx here[^].
|
|
|
|
|
I want to get and set values and trigger events in a website that loads inside a WebBrowser object
so, i cant get the code right i get NullReferenceException
WebBrowser_Main.Navigate("the_link");
while (WebBrowser_Main.IsBusy == true)
{
Application.DoEvents();
}
HtmlElement textbox_username = WebBrowser_Main.Document.GetElementById("user");
HtmlElement textbox_password = WebBrowser_Main.Document.GetElementById("password");
HtmlElement button = WebBrowser_Main.Document.GetElementById("submit");
textbox_username.InnerText = "the_username";
textbox_username.InnerText = "the_password";
button.click();
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Hi! I need to make repeated calls to a DLL from C#. Anyone knows how I can go about doing this? Or website I can read about this? I have searched a few websites and tried the suggestions but they didn't do what I need them to do. Thanks.
|
|
|
|
|
Look up "PInvoke". That allows you to call a native DLL from C#.
|
|
|
|