|
Hi,
your two images have different sizes, so something is scaling down (and harming quality while doing that).
Possible culprits:
- you have a PictureBox and have set the display mode to "Scale";
- you have a system with a non-standard dpi setting (default is 96dpi, somewhere deep down in
Display Settings, you can increase that number, resulting in some strange effects).
|
|
|
|
|
about the 2 suggestion
-the display mode for the PictureBox is in "Scale" already
-I created in photoshop photos with dpi up to 5000 and all of them just turn to the bad resolution as soon as I put them in the application ( (
|
|
|
|
|
Hi,
what is the value of PictureBox.SizeMode?
you might want to show all the code relating to the PictureBox.
Any chance of publishing the actual PNG file, so we could experiment a bit with it?
|
|
|
|
|
this is the PNG file (it was already published)
http://img27.picoodle.com/img/img27/4/7/12/f_OriginalImam_f44b121.png
this is after I use it as a background image in the form
http://img34.picoodle.com/img/img34/4/7/12/f_Thisisafterm_5d8b51e.jpg
I tried SizeMode=StretchImage && also I tried SizeMode=Zoom
and both still have the same bad resolution
|
|
|
|
|
Hi,
I can paint your PNG image on a Panel at different scales and it always looks good.
Your JPG captured image has several anomalies:
- where is the little close box coming from (top, almost right)?
- seems like it was first scaled down a lot, then scaled up again.
could it be the image gets loaded while the PictureBox is small, then the PB size gets increased
but the image itself is no longer available? or something similar?
Anyway I wouldn't trust a PictureBox much, and do my own scaling, hence SizeModes Normal and AutoSize
have my preference.
Have you been playing around with alpha channel, transparency?
Tell us the entire story, and show us some code.
|
|
|
|
|
Looks like the PictureBox is scaling and compressing the image in some way. What I would suggest is scaling the image to the correct size that will be used in the application using a program like Photoshop or Paint.NET. These use proper resizing algorithms that don't produce such a edgy result by using some sort of anti-aliasing.
As for the second image, I don't know where the compression artifacts suddenly come from as a PictureBox does support PNG images. I guess this is just because you used the jpg format to save the screenshot.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Actually I generated the png file from Photoshop and it generates as you see a very good results but the problem is when I'm using it as a background image, it looses its resolution, and no the bad resolution at the second page is not because of the screen shooting it's the look of the form I have.
no one face such a problem before I thought that it's common, how do you create your forms???
|
|
|
|
|
Hey everybody!
I wrote a COM visible C# dll for my application, and everything works great (Thanks to one of code project's articles of course! )
I'm using this C# COM from a C++ application (not .Net).
The is in the error handling. Exceptions don't go through from the C# COM to the C++ (like _com_error).
Right now I'm passing a parameter that will store the error, if there is one.
So, What I want to know is, is there is a way to make the exceptions is C# be thrown back to the C++?
Thanks!!!
|
|
|
|
|
hello
how can i draw address dynamicaly in c# similar paint brush
(draw line,rectangle,text,...)
|
|
|
|
|
ham rez wrote: how can i draw address dynamicaly in c# similar paint brush
what does it mean ?
ham rez wrote: (draw line,rectangle,text,...)
using System.Drawing
cheers,
Abhijit
|
|
|
|
|
Stupid question, I admit, but I'm quite new to C#: how can I write a method which accepts a single input parameter or a collection (e.g. array) of this parameter?
For example, let's say I have the method void MyMethod(int[] args) . If I try to call the function with a single argument, like MyMethod(1234) , the compiler obviously throws an error (int != int[]).
Overloading surely solves the issue (i.e. defining both void MyMethod(int[] args) and void MyMethod(int arg) and factoring out the common behaviour in a different private method) but is there a simpler way to do this?
Regards,
Andrea
|
|
|
|
|
I think I've just found the answer by myself: void MyMethod(params int[]) .
It was a stupid question, indeed!
Bye,
Andrea
|
|
|
|
|
that was not a stupid question, it was just simple, sometimes you want to find something that you can describe it to a person but can not describe it to a search engine
I Wish the Life Had CTRL-Z
Wizard's First Rule : People are fool,they believe what they want to believe or what they afraid to believe
www.subaitech.blogspot.com
|
|
|
|
|
Yes, that's how I'd go, but you could also overload the method, have both methods.
Oh, of course, you said that. What I should add, is that with overloading, you don't need to "factor out to a private method", you could simply have one method call the other:
void MyMethod(int[] args) { ... }
void MyMethod(int arg) { MyMethod ( new int[] { arg } ) ; }
And leave all the functionality in the one main method. I rarely have to resort to a private method.
|
|
|
|
|
Metal76 wrote: It was a stupid question, indeed!
Not at all, the solution is not very obvious. It might not be the entire solution, either.
You may want to overload that method with one that takes a single int , that way you can call it without having the compiler generate code that creates an array object every time (for the params array). Perhaps also add overloads that takes two and three parameters. The string.Concat method is overloaded in that way, for example.
Another overload that you may want to add is one that takes an IEnumerable<int> , that will work for an int[] , but also for other collections, like a List<int> .
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
i've made 3 methods and all the 3 methods are very heavy weight code as the download htmldata so applied threads on each method
using
ThreadStart starter = delegate
{
the method called here
};
new Thread(starter).Start();
and used
progressBar1.Maximum = 100;
backgroundWorker1.WorkerReportsProgress = true;
backgroundWorker1.ProgressChanged += new ProgressChangedEventHandler(backgroundWorker1_ProgressChanged);
backgroundWorker1.DoWork += new DoWorkEventHandler(backgroundWorker1_DoWork);
backgroundWorker1.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker1_RunWorkerCompleted);
backgroundWorker1.RunWorkerAsync();
like this i've used 3 backgroundworker for all three methods separately
but still after the 3rd backgroundworker progressbar completes but the threads are still running so now i just want to know how can i make the UI thread responsive till all threads complete asynchronously.
your all advice are appreciated!!
cheers
Paritosh Tripathi
B.Tech. (C.S.)
|
|
|
|
|
Hi,
please publish actual code, not something that resembles your code but would by no means compile.
Why are you using a Thread AND a BackgroundWorker (3 each), just have the job done by the BGW,
it can both execute the job and report progress.
|
|
|
|
|
Technobizz,
Like Luc said, show some actual code. Also, how do you update the progress changed?, do you just pass it the current position in the iteration (i am guessing you're using a loop somewhere) or the actual percentage complete?, there is a difference.
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
try
{
int row = 0;
int col = 0;
row = e.RowIndex;
col = e.ColumnIndex;
object val1 = dataGridView1[col, row].Value.ToString();
MessageBox.Show(val1.ToString());
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
error: object reference not set to an instance of an object
i'm getting this error. Please tell me how to correct this.
I've created a cellcontentclick event to get the row and column index where the checkbox is checked now i want to get the particular column value at this rowindex. As i want to get the address column data corresponding to the row in which checkbox is checked.
Thanks in Advance
Cheers
Paritosh Tripathi
B.Tech. (C.S.)
|
|
|
|
|
Hi All,
I have been trying to figure out how to
-
- Read streaming data from a html code, not from a file, (i.e. .....)
- Cleanup some of the ugly code in that streaming data
- Display the tidy code on a new browser windows
Do i need to use binaryReader/Writer? Please advice
Any idea or sample to check out. Thanks in advance
modified on Saturday, July 12, 2008 3:32 AM
|
|
|
|
|
Any one can provide me any info?
|
|
|
|
|
Hello,
I'm writing application with very complex configuration (System.Configuration). I need to pass ConfigurationSection or ConfigurationElement inherited class object as a method argument, but method executes in separate AppDomain, since neither ConfigurationSection nor ConfigurationElement doesn't inherit from MarshalByRefObject classs I constantly get a SerializationException exception.
If I add SerializableAttribute to my configuration section it works, but I can't modify any variable.
What can I do ?
Thanks in advance.
|
|
|
|
|
Hi guys! is there anyone who knows how to retrieve photos from sharepoint 2007 using C#? Urgent, Thanks!!!
|
|
|
|
|
|
Use the System.Diagnostics namespace. It includes the Process object that lets you run external programs.
using System.Diagnostics;
...
...
Process p = new Process("notepad.exe");
p.Start();
It also includes methods such as WaitForExit() that tells your program to wait till the process it terminated, and also the 'StartInfo' that lets you set customized settings for running a program. Browse the namespace for more details.
|
|
|
|