|
yeah, I believe so.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
|
Ok few more questions:
1) How is the coordinate plane set up? Like where would the origin be?
2) could a point be outside of an image?
|
|
|
|
|
Hey:
I have understood the following problem...that u want to convert a rectangular image into two triangles...
"first thing no bitmap is in the form of triangle...Because(by definition) a Bitmap is a rectangular array of pixels...so it can never be triangle"
However u can read the image using byte array...with the help of Marshal.copy method....then copy Half of the array to 1st image array & half to the 2nd image array....
again use.Marshal.copy()method) to convert the bytes array to Bitmap image....
For all the above u must have concept of the following:
1-BitmapData
2-Safe & Usafe code
3-Marshal.copy()method.
Th nks
"Programming is a fun"
|
|
|
|
|
Rao Rafique wrote: However u can read the image using byte array...with the help of Marshal.copy method....then copy Half of the array to 1st image array & half to the 2nd image array....
Not a triangle, you couldn't. Not unless you copied one row at a time. And I explained that in depth, you can have the bytes in memory, but not in a format you can view.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
Hello,
lam using the next method of the random class to return integer between 0 and 15 but it repeats some numbers.
so what can I do to prevent it from repeating numbers?
Dad
|
|
|
|
|
you can't, that's what 'random' means.
To do what you want, build a list of 16 ints, 0-15. Get a random number from 0-15 and pull that index out of the array. For your next number, get a random digit between 0 and 14. And so on.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
Christian Graus wrote: To do what you want, build a list of 16 ints, 0-15. Get a random number from 0-15 and pull that index out of the array. For your next number, get a random digit between 0 and 14. And so on.
That wouldn't help much because even if you reduce the number each time, you can still get the same number multiple times (if the first Next() returns 3, nothing stops the next call of the method to return 3 again).
You should save the numbers in a generic List, because it has a variable amount of items and you can still access the items by int indexes.
Then call Next() and after getting the value from the list, remove the index that just has been generated by Next (you need to save its result in some variable).
For the next step, you'd need to create a new random with the changed count of the now smaller List as seed (why can't you change the seed of a random after it's been created anyway?).
|
|
|
|
|
Hi all.
How can i hide the mail address of the "sender" of a mail in C#?
Thanks.
|
|
|
|
|
How do you mean ? If you're sending the mail with C#, then you can specify whatever sender you like.
I assume you're writing some sort of hostile mail bomb or spam program. Why do you want people to hate you ?
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
I read it the same way. If he doesn't understand something that trivial, he'll get nailed for sure!
|
|
|
|
|
What you are asking for is not possible. An email message has to have a sender.
You can put any sender address you like in an email message, then it depends on your mail server what addresses it allowes as sender.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thanks for the replays.
The problem is this:
I've made a software for save password,and i've insert in it a service "password recovery" thath send a mail with the password of the account (if the user have insert it).For this i'm using my gmail account.
But i've try to send a mail to me (to another address, and so i've see that the user can see my mail address).
How can i avoid the problem?
If i have to create another mail account,can you advice me what service to use? (a free service that i can use with C# and i can block the replay).
Thanks.
Ps:sorry for bad english.
|
|
|
|
|
I have a table that I want to display one column to a user for viewing only via a windows form. What is the easiest way to display this data?
I was looking at the DataGrid, but I am not sure how to load this. Any sample code or articles on this componet would be great.
Thanks!
|
|
|
|
|
Just do a search of the articles on this site for something like "Bind data AND grid", and I'm sure you will find multiple examples.
|
|
|
|
|
Set the datasource of the grid and call the databind method. Look for some articles for more info on how to format the data.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
First of all let me apologize for posting this without searching about it first.
I'm doing this because I'm in a hurry and I need to leave my work right now, and I was in the middle of this problem.
Well I'm starting on p/invoke just now and I can't make it work.
I created a class with all methods I need to call from the dll and it looks something like this:
[DllImport(@"MitraLib.dll", EntryPoint = "MitraConectaBD", CallingConvention = CallingConvention.StdCall)]
public static extern int MitraConectaBD(IntPtr AsUsuario, IntPtr AsSenha, IntPtr AsBanco, bool AbLoginPrompt);
Well, with the class created I started to code what I wanted:
public Form1()
{
Thread.CurrentThread.Name = "MAIN";
InitializeComponent();
IntPtr ptrLogin = Marshal.StringToHGlobalAnsi("oscar");
IntPtr ptrSenha = Marshal.StringToHGlobalAnsi("1");
IntPtr ptrDataBase = Marshal.StringToHGlobalAnsi("Gerencial2000i");
int retCode = MitraLib.MitraConectaBD(ptrLogin, ptrSenha, ptrDataBase, false);
Marshal.FreeHGlobal(ptrLogin);
Marshal.FreeHGlobal(ptrSenha);
Marshal.FreeHGlobal(ptrDataBase);
}
Well, when I try to compile my project I get an exception saying
(translated to english by myself)
It wasn't possible to load the DLL 'MitraLib.dll': It wasn't possible to find the specific module(Exception HRESULT: 0x8007007E)
or something like that.
Does anyone have any clue?
I'm sorry again for posting this withou searching the forum (although I googled it but didn't find anything)
ps. MitraLib.dll is a Delphi code.
Thanks in advance
Oscar
|
|
|
|
|
Not sure, but try removing the namespace:
int retCode = MitraLib.MitraConectaBD
|
|
|
|
|
Hi there!
Thanks for the attention.
But no, that didn't work. When I remove MitraLib the method MitraConectaBD stops belonging to the current namespace!
I forgot to tell on my first post: My MitraLib.dll file is already in bin\Debug and in bin\Release folders.
Also, in the project properties, the output path in in Build tab is already set to bin\Debug
But still doesn't work...
Is there any extra configuration I should make to work?
Thanks again!
|
|
|
|
|
Another thing,
I've just copied MitraLib.dll to my system32 folder and now it works!
But how can I make it search in bin\Debug ?
Thanks again!
|
|
|
|
|
Make sure you have MitraLib.dll in a folder where the compiler can find it. I'd try to have it in the same folder as your source code or C:\Windows\System32. Be aware that you may need to put it in your <project folder="">/bin/Debug folder if you want to run and debug the project.
|
|
|
|
|
Hi Kythen, thanks for the answer!
I forgot to tell on my first post: My MitraLib.dll file is already in bin\Debug and in bin\Release folders.
Also, in the project properties, the output path in Build tab is already set to bin\Debug
But still doesn't work...
Is there any extra configuration I should make to work?
ps. Just copied MitraLib.dll to system32 folder and now it works!
How can I change the path of my project to search in bin\Debug??
Thanks again!
|
|
|
|
|
Hi,
this looks like a run-time error. Make sure your DLL is in a folder where Windows will look for it
(using PATH). Good candidates are: the folder holding your EXE (that would be a /bin/debug folder)
or C:\Windows\system32 (not recommended).
|
|
|
|
|
Hi Luc, thanks for the answer!
I forgot to tell on my first post: My MitraLib.dll file is already in bin\Debug and in bin\Release folders.
Also, in the project properties, the output path in Build tab is already set to bin\Debug
But still doesn't work...
Is there any extra configuration I should make to work?
ps. Just copied MitraLib.dll to system32 folder and now it works!
How can I change the path of my project to search in bin\Debug??
I can't let my application search in system32... it's not good for me...
Thanks again!
|
|
|
|
|
Hi,
AFAIK the EXE will look first in its own folder, only then use the Environment Variable "PATH" to
determine where to look next.
Be careful with outdated DLL copies.
I would suggest to remove all your DLL copies, and have just the one in the EXE folder itself.
Also make sure no older copies of your program are still running!
What is your OS?
|
|
|
|