|
well ok.. u mean that if user wana draw the linear line it will be a straight line and if the user wana draw a constant line it will be only a point and nothing else? is it? and the third one that is parabola..and it means that in which ever direction the mouse is moved it should draw parabola..?? will u plz tell em i right or not?
Actualy sumone told me this..
constant — This distribution will place an equal amount of paint at each pixel within the airbrush’s radius.
linear — This distribution will place a linearly decreasing amount of paint at each pixel as you move away from the center point. So at the center point, you will have full intensity of paint, whereas at radius pixels away from the center, no paint will be put on the canvas.
quadratic — This distribution will place a quadratically decreasing amount of paint at each pixel as you move away from the center point (i.e., the amount of paint used as you move away from the center decreases with the square of the distance). So, as with the linear distribution, the center point will have full paint intensity, whereas at radius pixels away from the center, almost no paint will be put on the canvas. There can be multiple ways to write the quadratic distribution. (Note: Your quadratic function should at least satisfy the property that when the distance x from the center of the circle is zero, the value of your function is "1", when the distance x is halfway to the radius, the value of your function is "1/4", and when the distance x is greater than or equal to the radius of your brush, the value of your function should be zero.)
i realy dnt understand these three points especially the last one..like how will decrease the intensity of the color..?? what i know is that v have a pen and assign sum color to it. like
Pen myPen = new Pen(Color.Red);
then how i will decrease the intensity of this color..??
|
|
|
|
|
Sorry, maybe I'm wrong because I just guest that. Actually, I cann't search any article about that. So sorry
|
|
|
|
|
All painting should be handled by the Paint handler, which has a PainEventArgs parameter, yielding a ready made Graphics. Creating your own Graphics does not make sense as it is expenive, slow, and needs a Dispose() call.
Luc Pattyn [Forum Guidelines] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
sory it was not in OnPaint() i just type the code and write it by mistake. its in MouseMove(). so thats y i create the graphics object in that function thats all.. but my question is still there.. actually i have to make a program in which user can draw linear line, constant line and quadratic line on mouse movement by clicking right or left buttons.. i dnt exactly know the difference between them..
|
|
|
|
|
Hi All,
I have to write a code for refreshing multiple databases at a time. The steps which it has to perform for refreshing databases are :
1. Source Server database backup.
2. Target Server database backup.
3. Capture user information.
3. Terminate active DB user .
4. Restore Database on target.
5. Drop existing user.
6. Re-create users.
7. Map users to the logins.
Can i write a stored procedure in c # itself to make this happen? If yes, please let me know how.
Thanks,
Vikas
vikas da
|
|
|
|
|
Are you talking about taking a backup of the database ?
|
|
|
|
|
Everything you specified is possible in stored procs ... Just to clarify, if you have Source and Target databases in the same instance of SQL server.
Create statements to in a single batch and make a stored procedure. Compile that in Master and access each database from there .
|
|
|
|
|
You can write store procedure in C# with Managed Code and after that you have to deploy dll to server
|
|
|
|
|
|
Thanks everybody ... I will try to implement with stored proc .. Have a nice time ...
vikas da
|
|
|
|
|
hi dudes,
i want to copy a table from an access database to another table on another access database in windows application using c#,what is the best solution,i dont want my application to hang while copying the data;i've tried reading record by record by a simple oledbcommand execute way,but it would take a long time,i have a lot of records in source database,how can i do the copy by using dataset?is using dataset the best solution? how? how can i relate a progress bar to that? i've seen a class named sqlbulk which works for sql databases that copies a large amount of data between tables or databases,but my database is access.i will be thankful for those who do me a favor and give me an answer.
|
|
|
|
|
Don't use DataSet. Work with a reader and iterate all the rows and insert into target database. Do this in a separate thread, so that your application won't hang.
Best wishes,
Navaneeth
|
|
|
|
|
Just to add to this, use a progress bar as well, so that the user can tell the app is still working. (Always use a progress bar if the app is going to do anything that takes over two seconds is a good general rule).
Nothing will speed the process up noticably, particularly if the two databases are on separate machines.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
"Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"
|
|
|
|
|
thank u both of my friends for ur answer,both of the answered gave me a pointer,but how can i relate copying data to a progress bar?
|
|
|
|
|
I need some help with a project im making it is pretty much a file archive system. It has the files in a single text file the file data is enclosed inside a head and a foot to identify it. which looks like this:
##:START:(FILENAME):(FILEDESTINATION):(FILESIZE):##
<CONTENT OF FILE HERE>
##:END--:(FILENAME):(FILEDESTINATION):(FILESIZE):##
the unpacker looks through the files and reads that data between the head and the foot and writes it into the destination directory it works for plain text files fine but when it comes to Executables the extracted file doesnt run and it has no icon anymore. Im using Encoding.Default to read and write all the data. Is there something im missing i think its possibly that the Encoding isn't quite right. When i open the exe in notepad and click save as it says its ANSI but that doesnt exist as a encoding type in Encoding.* would this be the problem?
|
|
|
|
|
fuze wrote: Im using Encoding.Default to read and write all the data.
Then you're not using the proper file methods to reading and writing binary data. You're treating everything as a text file, even the executables. You should be using the Binary Reader/Writer.
|
|
|
|
|
hi
i have wcf service host
and i keep all my clients callback in a list
is it possible to send this call back to one client so he will use the other client callback function
|
|
|
|
|
I want to know a serious problem: in my searches about storing data I find that I can store it in : XML Schema, or databases: SQLite, or any other db etc.
I want to store some int 's into a XMLS to be able to use them after I restarted the app.
My actual problem is: It is possible to store inside the actual app?
I don't want to store outside that app,in some sort of file.
thx.
OR a better question: How to store some data INSIDE running app, and then after restarting that app, the data remain there and be accessible ?
|
|
|
|
|
No, a running app cannot modify its code files (EXE, DLL); they are all locked as long as the app runs, so you can't rename, delete, or modify them.
Luc Pattyn [Forum Guidelines] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
True on the surface, but using shadow copies of the assemblies does allow them to be modified while running. AppDomain and Shadow Copy[^]
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
You can use the app.config file to store values or the settings file[^]
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
or any other file for that matter.
Luc Pattyn [Forum Guidelines] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
yeee I find it and it does a great job indeed.
ha. I must now find a way to integrate an array there.
Here is How To Save Inside Your App !
1. select a button in the designer, open Properties for it, and see the first property named "ApplicationSettings". Click on the + sign to open his sub-properties. At the "text" property click the down arrow and it appear a little box-window. There inside click on the "(New...)".
2. At this stage, you should see a window named "New Application Setting". Change the name to "mySetting", Scope = User, Default Value = "aha". Click Ok.
3. (optional) To verify if all is how you want to be, open Solution Explorer - Properties-Settings.settings. A new window appear and open the Settings tab from the left. You will see there all your custom settings.
A little advice: select the button in the designer, go to it's properties again, and at it's Name property verify if it has the "aha" value there. It must be there, because you set it in the Default Value, last time.
4. In the code for that button, write this:
private void buttonSave_Click(object sender, EventArgs e)
{
if (buttonRestore.Text == "aha" )
{
buttonRestore.Text = "-!aha!-";
}
else
{
buttonRestore.Text = "aha";
}
Properties.Settings.Default.Save();
}
5. Run your app, click the button to change it's appearance, and restart app.
VOILA!
|
|
|
|
|
I think I find a BUG for this "ApplicationSettings".
It's about after I compile the program.
If I move the myprogram.exe on another folder or partition, the values that I originally stored, they disappear.
It only retain the information data if is Not moved.
WHERE THAT DATA GO, AFTER ALL?
Is inside it, really?
Or is somewhere stored in some temp file?
thanks.
|
|
|
|
|
If you look at the documentation for "Properties.Settings.Default" you will find it is saved in a file called "<yourappname>.exe.config" in the same directory as the application executable (i.e. ".../bin/debug" or ".../bin/release") If you copy this file when you copy your executable, you will be fine. The only other option is to store it in the registry, but this is not recommended:
1) Registry use is being discouraged, as it make it too big and cumbersome.
2) It is difficult to move your settings from one machine to another.
3) It is impossible to transparently have different settings for debug and release versions of your software.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
"Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"
|
|
|
|