|
ya i m using the graphics object by overridng the paint method but still it creates mulipte copies
then what shud i do??
|
|
|
|
|
I'm not sure what you mean by 'multiple copies' ? Do you have a memory leak ?
You can't rotate an image in place, you can't rotate it without making a copy. Doing it in your paint method makes a copy direct to the DC, and so costs nothing.
Christian Graus - C++ MVP
|
|
|
|
|
no no !!i dnt mean that for memory
let me expalin u
suppose i hav a image having text "SIg"
when i apply roation to that image it writes multiple times "Sig" "sig" on same image.it make partitions of that image .which creates problem
|
|
|
|
|
OK, that's because your code is wrong, obviously. Post your code.
Christian Graus - C++ MVP
|
|
|
|
|
now i solved my poblem by using DrawImage method,but now i m suffering from another problem that how will i change
g.DrawImage(, ,) into bitmap?
|
|
|
|
|
Build the graphics object from a bitmap ( Graphics.FromImage ), then call that method to draw onto it.
Christian Graus - C++ MVP
|
|
|
|
|
Hi! i want to write a window service that splits a pdf file using an open source library. i m using pdfsharp open source library. in window service i want to pass input path of file as well as output directory path. window service split this input pdf file into output path using open source lib. please help me..
SAMir Nigam
|
|
|
|
|
I hope this is something you could use...
http://www.paologios.com/[^]
This Paolo Gios posted some articles on codeproject and that is how i know of him...
Regards
Nico
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
When I try to install my .net application in windows2003 & SBS I get a strange problem.
All the colors set for the forms doesn't appear. All the forms turn out to be ash in color.
I'm using framework v1.1.
With the same configurations it works fine in xp machine.
Could somebody help me pls...
Thanks in advance..
|
|
|
|
|
I've been working on an online judge(for ACM/ICPC) using C#.Programmes
submitted by users can now be compiled,and it's the problem to judge them.I
use the Process class in C#,and my thread is as follows:start a process
using this class with parameters such as input file,output file,etc,and
when the programme is running,i get its running information such as
running time,used memory,etc.I code as follows:
Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
//the following line are parameters,by combining them we get //command like this: cmd.exe /C C:\\aaa.exe < C:\\aaa.in > C:\\aaa.out exit
p.StartInfo.Arguments = "/C "+workPath + _pid.ToString() +
".exe <" + probPath + _pid.ToString() + ".in >" + workPath +
_pid.ToString() + ".out &&exit";
p.StartInfo.CreateNoWindow = true;
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
p.Start();
//while (!p.WaitForExit(_timelimit))
while(!p.HasExited)
{
p.Refresh();
memory = (int)(p.WorkingSet64 >> 10);
runtime = p.UserProcessorTime.Milliseconds;
Thread.Sleep(15);
}
hopefully to get info of programme,it really does!but the result is
just strange.for instance,i write the following C file:
#include <stdio.h>
int main()
{
int i,j;
for(i=0;i<1000000;i++)
for(j=0;j<100;j++);
return 0;
}
it comes out that this programme uses around 1800KB memory(this may be
normal),but 0ms time----this is almost impossible! I test it alone,it
run at least 400ms!
there's another weird example:
int main()
{
int i,j;
scanf("%d%d",&i,&j);
printf("%d",i+j);
return 0;
}
this simple programme should use as much as 1600KB memory!!!
Is there anyone who can tell me what's the problem with my
programme?I ever heard that using managed codes to get memory and time is not accurate,is it true?Or is there any better way to get used memory and running time of a programme(not necessarily use C#,can use c,c++,etc---but better on Windows platform)? Appriciate your help!
|
|
|
|
|
Hi all,
How do you format the system date according to mysql date format? When I give the data type as date in mysql, there's an error message saying cannot convert data/time to mysql date format. How do I overcome this?
Thanks for any reply.....
|
|
|
|
|
public static void DisplayTimeEvent( object source, ElapsedEventArgs e )
{
if(source==myTimer)
{
frmRun.getDanceModel(); <-- this line gets an error message "denotes a field where a class is expected"
}
}
how do I call any function when timer has elapsed? I don't quite understand why DisplayTimeEvent doesnt allow a function to be called.. Thanks much
|
|
|
|
|
If FrmRun is the name of your class -as I guess-, then for sure you'd get this error. Did you instantiate your class first?
Also the way you compare the source with the desired timer is quite odd. I guess you have multiple timers, and you have one handle for all of them? Otherwise if one timer only fires this event then no need to compare.
A suggested version of the handler would be this
public static void DisplayTimeEvent( object source, ElapsedEventArgs e )
{
Timer test = source as Timer;
if(test != null && test == myTimer)
{
frmRun MyForm = new frmRun();
frmRun.getDanceModel();
}
}
PS.
You did declare your method correctly, didn't you? Did you successfully call it from another method?
Regards
|
|
|
|
|
Thanks, however my problem is, frmRun has already been previously instantiated and what I want to do is call a function in frmRun which increments a value that is in frmRun. However the function doesnt recognize a variable that has been instantiated not in DisplayTimeEvent itself. How do I go about this problem? Thank you very much!
|
|
|
|
|
1. I created a c# class.
2. Ran regasm file.dll /tlb
3. Ran gacutil -i file.dll
Now I'm trying to create an instance of this in VC++ or view it as an object in OLECOMViewer (comes with VS.NET) but I keep getting
"80070002 system cannot find specified file" error when trying to instantiate this object or view its com object in olecomview.
Can anyone help? I just need its funcionality in VC++.
thanks all!
L
|
|
|
|
|
How do you sort arrays?
What is the exact structure?
Basically, I have four numbers that need to be sorted in ascending order, but I haven't the faintest idea where to even begin.
Any help would be much appreciated!
Thanks
|
|
|
|
|
Array.Sort is what you need.
Christian Graus - C++ MVP
|
|
|
|
|
I'm reading an article now but wan't to know if anyone has done this?
M.E. Guzman
|
|
|
|
|
I'm not sure how else you could do it ?
Christian Graus - C++ MVP
|
|
|
|
|
Certain IO methods, particularly FileInfo.LastWriteTime and FileInfo.Size are excruciatingly slow, especially the first time around.
I know the first time around is slow because the files haven't been cached yet. But it's excruciatingly slow; for a folder of about 1000 files, the cmd.exe dir command can do it in a few seconds whereas it takes System.IO.File and System.IO.FileInfo more than 30 seconds.
I noticed PowerShell has this problem too, since the ls/dir cmdlets use FileInfo as well.
Any ideas on a workaround/remedy?
Thanks in advance,
Rei
|
|
|
|
|
Write the code to do it in C++, perhaps using C++/CLI so you can call it from C#.
Christian Graus - C++ MVP
|
|
|
|
|
Hi,
I am trying to create some custom sound effects to use with the directx 9 managed code for c#. There are some effects that are bundled with the directx SDK but I would like to know how to go about creating my own. I need to know how I can route the audio signal from a secondary buffer through my own effects classes. Has anyone managed to do this? - I can't seem to find any info on the web about creating your own effects using c# with directx. If someone could point me in the right direction I would be very pleased!
Thanks.
|
|
|
|
|
Hi;
I want to know if there is a formula to determine if the user is moving the mouse clockwise or counter clockwise.
If there is could you explain to me?
Thanks
Hadi
|
|
|
|
|
Maybe this[^] will help
led mike
|
|
|
|
|
Calculate the angle for a vector from the center point to the mouse pointer, and watch how the angle changes.
---
b { font-weight: normal; }
|
|
|
|