|
Not to be offensive... but really... NOT the point and NOT the answer to the question.
|
|
|
|
|
jano_rajmond wrote: Not to be offensive... but really... NOT the point and NOT the answer to the question.
Likewise - Don't tell me what I have on my laptop, no offense of course.
I don't know if Enlish is your first language or not, but the phrase "just like all of us" tacked onto the end of a statement implies (or I've only ever heard it used to imply) that if the statement is not true for the listener/reader then he/she is somehow mentally deficient/wrong/retarded/idiotic/etc. I don't like being called that.
|
|
|
|
|
Yes... you not having multimedia controls on your laptop does make you deficient... of multimedia controls. You also are all the other words you mentioned, but not because of the absence of MM controls on your laptop but because you keep answering this post without really having anything REMOTELY RELATED to say about THE REAL QUESTION. So if you don't like being called "those things" stop acting accordingly.
P.S.: No, English is not my first language, but as you can see I speak it quite well. And please, I'm begging you, look up the phrase "just like all of us" in a dictionary!
|
|
|
|
|
jano_rajmond wrote: And please, I'm begging you, look up the phrase "just like all of us" in a dictionary!
You'll have to provide a link because I couldn't find it in a dictionary (on- or off- line). Idiomatic expressions often aren't in dictionaries unless you happen upon them through a specific word.
jano_rajmond wrote: You also are all the other words you mentioned, but not because of the absence of MM controls on your laptop but because you keep answering this post without really having anything REMOTELY RELATED to say about THE REAL QUESTION.
Note that I did mark my post as being "not an answer" so others can easily identify that it does not contain an answer.
I was mearly pointing out that in your original post you may reduce your chances of getting an answer because someone could have misinterpreted your opening statement as an implicit insult if the condition was false.
|
|
|
|
|
Colin Angus Mackay wrote: You'll have to provide a link because I couldn't find it in a dictionary (on- or off- line). Idiomatic expressions often aren't in dictionaries unless you happen upon them through a specific word.
Oh... well, I guess that is why you have no idea that is has absolutely no offensive connotations. I was hoping that those who didn't actually have the respective keys could just ignore that part, you know, like *normal* people do.
Colin Angus Mackay wrote: as an implicit insult
Yes, I head African-Americans rolling in "da hood" swearing and insulting each other using those exact words. I even heard that someone actually got shot for using the phrase "just like all of us" when it wasn't 100% true.
|
|
|
|
|
I have multimedia keys on my laptop, and I know how to use them, manually and programmatically.
And if I would not know, I would know how to find out in a matter of seconds.
This being the weekend, I take a few days off, just like all of us.
|
|
|
|
|
Well then, have a nice weekend!
If I knew the answer and someone was asking for it, I would just paste a link or something, and I would feel much better about myself in the weekend cause I helped someone who needed it... just like most of us.
|
|
|
|
|
I know of no library to do what you want - I chuck keyboards away if they have all the MM and internet key and buy a business keyboard.
Create and app and detect the keydown event on a form to identify the keys and deal with them the way you need to. Doesn't every developer have a test app where snippets are tried
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi!
How do I save CDATA Object in an XML file?
Thanks
|
|
|
|
|
CDATA is a type of node in an XML file, it isn't an object. You might like to rephrase your question.
|
|
|
|
|
HI all,
i'm trying to populate a panel with an array of picture but when i debug the program is so slow to download the picture in the panel.
i have this code snippet :
public partial class ArtLabel : Form
{
private System.Windows.Forms.PictureBox[] imgArray;
public static string ImageToShow;
private int NumOfFiles;
private string[] imgExtension;
public ArtLabel()
{
InitializeComponent();
panel1.VerticalScroll.Visible = true;
panel1.VerticalScroll.Enabled = true;
panel1.VerticalScroll.Value = panel1.VerticalScroll.Maximum;
}
private void ArtLabel_Load(object sender, EventArgs e)
{
GetPicture4(@"D:\\Music\\");
}
private bool ThumbnailCallback()
{
return false;
}
private void ARR(int cNumber, string exc)
{
int Xpos = 8;
int Ypos = 8;
Image img;
Image.GetThumbnailImageAbort myCallback =
new Image.GetThumbnailImageAbort(ThumbnailCallback);
imgArray = new System.Windows.Forms.PictureBox[cNumber];
for (int i = 0; i < cNumber; i++)
{
imgArray[i] = new System.Windows.Forms.PictureBox();
if (Xpos > 432)
{
Xpos = 8;
Ypos = Ypos + 72;
}
imgArray[i].Left = Xpos;
imgArray[i].Top = Ypos;
imgArray[i].Width = 64;
imgArray[i].Height = 64;
imgArray[i].Visible = true;
imgArray[i].SizeMode = PictureBoxSizeMode.StretchImage;
img = Image.FromFile(exc);
imgArray[i].Tag = exc;
imgArray[i].Click += new System.EventHandler(ClickImage);
imgArray[i].Image = img.GetThumbnailImage(64, 64, myCallback, IntPtr.Zero);
panel1.Controls.Add(imgArray[i]);
Application.DoEvents();
Xpos = Xpos + 72;
}
}
private List<string> GetPicture4(string Folder)
{
DirectoryInfo dir = new DirectoryInfo(Folder);
List<string> str = new List<string>();
FileInfo[] files = dir.GetFiles("*.jpg", SearchOption.AllDirectories);
int NumOfFiles = files.Length;
imgExtension = new string[NumOfFiles];
for (int i = 0; i < NumOfFiles; i++)
{
ARR(i, files[i].FullName);
str.Add(files[i].FullName);
}
return str;
}
private void ClickImage(Object sender, System.EventArgs e)
{
ImageToShow = ((System.Windows.Forms.PictureBox)sender).Tag.ToString();
Direcoty_Prova.ViewPicture f = new Direcoty_Prova.ViewPicture();
f.ShowDialog();
}
}
My purpose of this code is to show the small label of Music Cd and after when i click on the small picture appear a new PictureBox with the picture in Real Size ,i can do it but the trouble if i wish store more than 30 picture in the Array of picture i must wait so long before that the form appear ,i don't know why.
Do you have any advice where i wrong in my code?
Thanks.
Nice Regards
|
|
|
|
|
ascotravel wrote: Do you have any advice where i wrong in my code?
yes.
1.
it is better to use Image.FromStream() rather than Image.FromFile() since the latter keeps the file locked. This is however not affecting performance AFAIK.
2.
it is much better to dispose of all objects you don't need any longer provided their class offers a public Dispose() method. Image class does, so don't just abandon img by assigning a new image to it, first do a if(img!null) img.Dispose(); That will reduce your memory consumption, reducing the work of the garbage collector.
3.
the basic idea of thumbnail images is you don't calculate them over and over; e.g. have your program create thumbnail files (with a modified filename), and look for them when loading. That will avoid the file load and the computation. For small images, avoid compressed formats such as JPEG; use BMP or GIF instead.
BTW: although some image formats support a built-in thumbnail, these are not always present. Furthermore the quality of GetThumbnailImage() is rumored to be not good.
|
|
|
|
|
Replace your ARR method with this:
private void ARR(int cNumber, string exc)
{
int Xpos = 8;
int Ypos = 8;
Image img;
Image.GetThumbnailImageAbort myCallback = new Image.GetThumbnailImageAbort(ThumbnailCallback);
imgArray = new System.Windows.Forms.PictureBox[cNumber];
imgArray[cNumber] = new System.Windows.Forms.PictureBox();
if (Xpos > 432)
{
Xpos = 8;
Ypos = Ypos + 72;
}
imgArray[cNumber].Left = Xpos;
imgArray[cNumber].Top = Ypos;
imgArray[cNumber].Width = 64;
imgArray[cNumber].Height = 64;
imgArray[cNumber].Visible = true;
imgArray[cNumber].SizeMode = PictureBoxSizeMode.StretchImage;
img = Image.FromFile(exc);
imgArray[cNumber].Tag = exc;
imgArray[cNumber].Click += new System.EventHandler(ClickImage);
imgArray[cNumber].Image = img.GetThumbnailImage(64, 64, myCallback, IntPtr.Zero);
panel1.Controls.Add(imgArray[cNumber]);
Xpos = Xpos + 72;
}
I've removed the loop, and the Application.DoEvents call. You were effectively creating the same PictureBoxes many times over
|
|
|
|
|
Hi Thanks to reply me so fast,
for Luc i will follow your advice as i'm a novice i need wise advice..Thanks
@Computafreak - Thanks to post the code but not luck .
When i debug the code in this line code :
<pre> imgArray[cNumber] = new System.Windows.Forms.PictureBox();
appear this error:"Index was outside the bounds of the array.".
I'm trying to work out it if i can i will post my solution.
Thanks a lot for your help.
Nice Regards
|
|
|
|
|
Hi,
If you remove the for loop from the ARR method you have to remove imgArray = new System.Windows.Forms.PictureBox[cNumber]; there as well, and allocate the array at the caller.
|
|
|
|
|
Hi Luc,
sorry i'm shame for my poor knowledge but i removed the loop For and i followed your advices but i receive always the same error .
What i do of wrong???
EDIT : if i remove <code>imgArray = new System.Windows.Forms.PictureBox[cNumber]; and after i debug in this code line
imgArray[cNumber] = new System.Windows.Forms.PictureBox();
i receive this error "Object reference not set to an instance of an object."
modified on Saturday, April 11, 2009 2:22 PM
|
|
|
|
|
Whoops. I missed that one. Follow the instructions at this link
|
|
|
|
|
Hi,
you need a imgArray = new System.Windows.Forms.PictureBox[NumOfFiles]; inside GetPicture4() and none of it inside ARR().
And I strongly suggest you buy a tutorial book on C# and study it. It is the only efficient way to make real progress.
|
|
|
|
|
I tried this code snippet:
private List<string> GetPicture4(string Folder)
{
imgArray = new System.Windows.Forms.PictureBox[NumOfFiles];
DirectoryInfo dir = new DirectoryInfo(Folder);
List<string> str = new List<string>();
FileInfo[] files = dir.GetFiles("*.jpg", SearchOption.AllDirectories);
NumOfFiles = files.Count();
imgExtension = new string[NumOfFiles];
for (int i = 0; i < NumOfFiles; i++)
{
ARR(i, files[i].FullName);
str.Add(files[i].FullName);
}
return str;
}
and after i remode this line
imgArray = new System.Windows.Forms.PictureBox[NumOfFiles];
from the Arr Method but i receive always this error "Index was outside the bounds of the array."
Really sorry maybe i misundertood your advice if yes please be patient i try my best.
Thanks a lot
P.S. i will buy a book as soon as possible,i need improve my English too
|
|
|
|
|
ascotravel wrote: imgArray = new System.Windows.Forms.PictureBox[NumOfFiles];
What do you think is the value of NumOfFiles at this point?
|
|
|
|
|
Okay Luc ,
I work out it after read an article about array ,i removed the method ARR() and i organize the code in the GetPicture4() creating the right loop and removing the messy code wrote down in past.
Thanks for your patience and sorry for my stupidity
Have a good work.
Nice Regards
|
|
|
|
|
How can I create Objects and make them resize them selves according to the Form.
Objects like text Boxes Buttons and more.
Is this is a property?
Thanks for your help
|
|
|
|
|
Look into the Anchor and Dock properties
|
|
|
|
|
Can anyone tell me why do we create DLL files for our project? What is the use of it?
|
|
|
|
|
Because sometimes they may contain support functions. Since they would just contain those particular functions, they're unlikely to contain an entry point, and this would mean that a DLL would be your only option AFAIK
|
|
|
|