|
how can i change the contrast of the image at the same time changing brightness. my brightness can change. its working fine i want to change the contrast at the same time....can i use this method too ???
Bitmap image = new Bitmap("d:\\14.jpg");
Bitmap bm = new Bitmap(image, 350, 300);
System.Drawing.Bitmap TempBitmap = bm;
float FinalValue = 0.5f;
System.Drawing.Bitmap NewBitmap = new System.Drawing.Bitmap(TempBitmap.Width, TempBitmap.Height);
System.Drawing.Graphics NewGraphics = System.Drawing.Graphics.FromImage(NewBitmap);
float[][] FloatColorMatrix ={
new float[] {1, 0, 0, 0, 0},
new float[] {0, 1, 0, 0, 0},
new float[] {0, 0, 1, 0, 0},
new float[] {0, 0, 0, 1, 0},
new float[] {FinalValue, FinalValue, FinalValue, 1, 1}
};
System.Drawing.Imaging.ColorMatrix NewColorMatrix = new System.Drawing.Imaging.ColorMatrix(FloatColorMatrix);
System.Drawing.Imaging.ImageAttributes Attributes = new System.Drawing.Imaging.ImageAttributes();
Attributes.SetColorMatrix(NewColorMatrix);
NewGraphics.DrawImage(TempBitmap, new System.Drawing.Rectangle(0, 0, TempBitmap.Width, TempBitmap.Height), 0, 0, TempBitmap.Width, TempBitmap.Height, System.Drawing.GraphicsUnit.Pixel, Attributes);
Attributes.Dispose();
NewGraphics.Dispose();
picDecode.Image = NewBitmap;
A S E L A
|
|
|
|
|
You can add the contrast and brightness matrices, I guess, or you can apply one, then the other.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
i could do it....but i got a big problem. as i told im doing a QR barcode reader by using webcam. my web cam pictures are too dark so i have to process image before i send it to decode. some times after process i code decode.but when the envirentmant change it couldn't decode. that mean when change brightness and contrast in enviranmetn i couldn't decode. is there any solution....may be auto brightness and contrast detect or some thing else....???
A S E L A
|
|
|
|
|
Hi,
I think you want a non-linear transformation, ideally something that maps all colors to either black or white. Maybe ImageAttributes.SetThreshold could help you out, provided you give it a good value, at best it would depend on the average brightness of your image,
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Hi,
I am using Pop3 in my application. In this I am able to access the mails in the given Email Id. Now I have to download the files or images attached to the mails and save them in a temp folder.
If anyone gave idea to solve this please reply me.
Thanks in Advance.
|
|
|
|
|
Are you using outlook ? Or have you written an actual POP3 server and written a mail program ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
I want to import some tables to a database in sql 2005. In a training video, I saw "all tasks" was used to realize this. despite using developer edition there is no all tasks. how can i use this all tasks function or how can i import tables with code.thanks
|
|
|
|
|
you are asking a database ? in the C# forum.
In management studio, open the object explorer, right click on your database and there should be a Tasks menu item. Under here lies you tools.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
i need it in sql manager screen
|
|
|
|
|
It's called SQL Management Studio in SQL 2005+
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I am writing a large data to MS access via reader.
I needed to change query from storedprocedure to text since I needed to create the database I was going to write. And I do not know to create a query in MS access via C#.
Now I recognized that the writing process slowed down significantly. Is it true that Stored Procedure works faster compared to commandtype.text.
Moreover do you know how to create query in MS Access via C#.
Thanks in advace
|
|
|
|
|
Not sure about Access but there are lots of discussions regarding SQL Server[^] that have been going on for what seems like centuries.
IIRC there is not longer a dramatic difference between then (in SQL). In Access you are screwed before you start so it probably does not matter.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thank you for the motivation :P.
|
|
|
|
|
Sorry but I class working with Access only marginally better than coding in VB6, now if you were doing both I would have some real sympathy !
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
All I want the procedure to do is execute the sql statement that I pass it. I do not want or need any result to be passed back as the stored procedures will update or or insert to the tables.
private void SQLExecution(string WhatismyConnectionString, string MySQLStatement)
{
//This is the command I am passing in the SQL Statement...
//It is a stored procedure that simply does a deletion to the table.
//WhatismyConnectionString = "sp_vc_NoLongerExist + @MachineName + @UserName + @AppName"
SqlConnection conn = new SqlConnection(WhatismyConnectionString);
SqlCommand command = conn.CreateCommand();
command.CommandText = MySQLStatement;
command.CommandType = CommandType.Text;
// execute the command that returns a SqlDataReader
object returnvalue = command.ExecuteScalar();
MessageBox.Show("YEA?");
}
|
|
|
|
|
Hi JollyMansArt,
Please open the connection before using it.
Also,close the connection after you finish with it.
himanshu
|
|
|
|
|
Open your connection
Commandtype should be command.StoredProcedure
Create parameter object and then define all your parameter and then add your parameter in command object as
command.Parametyer.Add(put your parameter object here)
And execute as ExecuteNonQuery command.ExecuteNonQuery
Thanks,
Atin
|
|
|
|
|
Open the connection
Niladri Biswas
|
|
|
|
|
Dear All,
I have following xml which i want to convert it into DataTable, but it doesent reports any record
the xml file contents
<DownloadedForms>
<row>
<CommunityCode>28-2801-0001</CommunityCode>
<FormName>Form6</FormName>
<FormPage>1</FormPage>
<FormPath>c:\PDF Files\BAMYAN\Bamyan\28-2801-0001\Form6\28-2801-0001-F6.pdf</FormPath>
<isVerified>2</isVerified>
<RejectionReason>The Form is Scanned in low Quality</RejectionReason>
<Id>6</Id>
<ProvinceID>28</ProvinceID>
</row>
</DownloadedForms>
and the code to read the xml file is
XmlTextReader read=new XmlTextReader("xmltopic.xml");
while (read.Read()) {
}
DataTable dt=new DataTable();
dt.ReadXml(read);
MessageBox.Show(dt.Rows.Count.ToString());
how can i convert that xml into dataTable?
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
Try
DataSet ds = new DataSet();
ds.ReadXml("FileName");
himanshu
|
|
|
|
|
Yes its working!!
go ahead with Himanshu code

|
|
|
|
|
|
do some googling
you will get it
|
|
|
|
|
Please, don't delete your messages. It's not helpful to other people who are searching for an answer to a related question
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
I am really sorry, In fact i was trying to response for "himunshu1256", but i dont know y the respone was automoated to "savetiger".
I had responed to "himunshu1256" two times, but in both the message was redirected to "savetigers"
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|