|
If I don't make mistake , when you set your Pen or Brush from a Color structure , you can set it with Color.FromArgb method. You have to set its first argument. (alpha)
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
Thanks for reply,
I know we can get Pen / Brush with alpha setting, but Graphis.DrawImage() does not contains alpha setting.
g.DrawImage( image, location);
the main problem is when I drawing some image on screen, it can't draw as transparency. Is there a way to set the alpha of Graphics property??
|
|
|
|
|
I think if you first draw your image , then you can draw your other objects like rectangle with this option and use transparency. Search for GDI+ articless in this site, maybe you get better solutions there.
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
For Xor drawing, you want to look into Regions[^]. See the Region documentation here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
hi
why this code dosnt work.
<br />
Graphics g = Graphics.FromHwnd(IntPtr.Zero);<br />
g.DrawLine(new Pen(Color.Red),50,50,500,500);<br />
g.FillRectangle(new SolidBrush(Color.Red),10,10,250,300);<br />
thanks
|
|
|
|
|
hello,
i have created a MDI form that contain two child forms
class ParentForm : Sytem.Windows.Forms.Form
{
........
void func()
{
this.IsMdiContains = true
ChildForm1 child1 = new ChildForm1();
child1.MdiParent = this;
child1.Show();
ChildForm2 child2 = new ChildForm2();
child2.MdiParent = this;
child2.Show();
}
my question is : i want to show both child1 and child2 and i`m using the next statement:
this.LayoutMdi(System.Windows.Forms.MdiLayout.TileHorizontal);
but the problem is that i dont want to see on the screen half from ChildForm1 and half from ChildForm2. i want to see the real size form definition of both Child forms. what should i do?
thank you
koby
|
|
|
|
|
You could try MdiLayout.Cascade instead and see if that layout works for you. If not, then you'll have to write your own code for laying out the child forms the way you want.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hai there,
when ever i created setup in vs.net Ide i am getting this error mesage,
C:\DOCUME~1\user\LOCALS~1\Temp\VSDA6C.tmp\Managed.D93ED6F5_1D53_11D4_A53C_0090278A1BB8\Program Files\Microsoft Visual Studio .NET 2003\Crystal Reports\Viewers\images\Tree\singleminus.gif' 'Interface not registered'
C:\Documents and Settings\user\Desktop\essdf\Setup1\Setup1.vdproj Could not find file 'C:\Documents and Settings\user\Desktop\Tops Planner Version 1.0.0 Source Freeze On 8- June- 2004 12 Am\12-13FT.ico' 'Interface not registered'
C:\Documents and Settings\user\Desktop\essdf\Setup1\Setup1.vdproj Could not find file 'D:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\Deployment\.\MsiRedist\1033\MsiLoadr.Bin' 'Interface not registered'
What is this 'Interface not registered'
any idea?
Please feel free to contact.
Sreejith S S Nair - Bangalore
|
|
|
|
|
I am looking for good .NET Profiler. Which do you use?
Wizard_01
|
|
|
|
|
|
Hi,
I am trying find the services which are running on my machine on polling basis, and I am trying write this to a file before shutdown. I am trying to do this using a service, I am writing the code for file writing in the OnStop() method of the service. The problem is my service starts and stops immediately. Why this is happening??
Code Snippet:
OnStop()
{
System.IO.StreamWriter file = new System.IO.StreamWriter("d:\\test.txt");
Process [] curentProcess= Process.GetProcesses();
foreach(Process p in curentProcess)
file.WriteLine(p.ProcessName);
file.Close();
}
Regards,
Satya
|
|
|
|
|
SatyaDY wrote:
my service starts and stops immediately
Your service does not even reach OnStop(), the problem is Main() or in OnStart().
To locate the failure, check the event log. Are there any exception messages from your service?
If not, you can write a log file during OnStart(), to see where the service stops.
|
|
|
|
|
check the event log
Yeah, I checked the event log, it's having entries for start and stop.
When I comment the code, for file opening and writing, I find it running without any problem. How the file writing of the process names giving the problem I couldn't get.
Regards,
Satya
|
|
|
|
|
ummm... I don't really have a solution to your problem, but I think I see a problem with your service. Basically, in order for your service to work, it has to be the first service to stopped during shutdown, else the GetProcess Method won't return those processes stopped before hand.
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
|
|
|
|
|
I think you are correct. Because the GetProcess couldn't get the Processes, file writing is also failing and the service is stopping immediately. Can we give priority (for making it first to stop)??
Regards,
Satya
|
|
|
|
|
I'm not too familiar with services, but you might try and see doing this
Thread th = Thread.CurrentThread;
th.Priority = ThreadPriority.Highest;
during onStart if it will help.
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
|
|
|
|
|
Whoa there Tex! Really bad idea. This will not give priority to the service to be shutdown first. As a matter of fact, you'll just end up slowing down the rest of the system doing this...
You can't give priority to any service to shutdown first. You might want to try overriding WndProc and watching for the WM_QUERYENDSESSION message.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Well, so much for that idea.
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
|
|
|
|
|
hi all
when change font property in windows forms,
dont change font title of form,Why.
how resolve it.
thanks,
|
|
|
|
|
Because the window caption font is set by the Display settings on your machine. It is a non-client area. You can set fonts in your client-area. It is possible set the font in a caption but there is no functionality to do this in the .NET FCL. You have to override WndProc for your main Form and handle the WM_NCPAINT message, for example, to have a different font than what the user preferences specify for a window caption font.
If you search CodeProject, there should be a few articles on non-client painting.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Heath, you really don't like it when people don't search CP or Google before asking questions on the message boards, do you?
Aaron Eldreth
TheCollective4.com
My Articles
While much is too strange to be believed,
Nothing is too strange to have happened.
- T. Hardy
|
|
|
|
|
People that can't research they own simple problems do not belong in this field, IMO. Asking questions like "What does this method do?" is stupid - consult the documentation for that method. If you still don't understand it - fine - then ask about it.
That doesn't really apply to this guy, though. Read me response a little more carefully. I told him what the problem was and asked him to search CodeProject. There are articles about this, so why should I waste my time typing a bunch of code that's already been written. I actually have some example code dealing with non-client painting in this forum that pre-date said articles that I've seen (good and bad articles) alike. Asking him to search here is merely a way to save time and typing. He didn't even know what to search for before; now he does.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I know I don't like it. What's wrong with going to MSDN and searching for
classname class .net
Bam! Everything you wanted to know about the class...
If you want to write code for a living or just be semi-good in the IT Industry, you absolutely have to posses the skills to do research and teach yourself! What good are you to your company if you can't research an answer to a support question or learn new design/coding techniques?
I come here to answer as many questions I can and learn during the process. Mostly, I read questions and if I already know the answer, post it. Otherwise, it's off to MSDN i go, do a little research, then post come back and an answer. But, after that, I'll watch for the answers that Heath posts so I can learn the finer points from him and see where I went wrong! He's corrected me on a bunch of occasions, and I don't have any problem with that all! I actually look forward to it.
It's all part of the learning process...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote:
I know I don't like it. What's wrong with going to MSDN and searching for "classname class .net"
I don't see anything wrong with it.
Dave Kreskowiak wrote:
Bam! Everything you wanted to know about the class...
And then some...
Dave Kreskowiak wrote:
I come here to answer as many questions I can and learn during the process. Mostly, I read questions and if I already know the answer, post it. Otherwise, it's off to MSDN i go, do a little research, then post come back and an answer. But, after that, I'll watch for the answers that Heath posts so I can learn the finer points from him and see where I went wrong! He's corrected me on a bunch of occasions, and I don't have any problem with that all! I actually look forward to it.
I think that Heath is omniscient. He seems to know everything. I wonder if that is a requirement to be a Microsoft MVP
Aaron Eldreth
TheCollective4.com
My Articles
While much is too strange to be believed,
Nothing is too strange to have happened.
- T. Hardy
|
|
|
|