|
My advice would be to try something out for yourself before you ask a question like this-- not because you annoy people, but because you'll learn more that way. I only ask people for help if it's something I can't get myself.
In this case, it's obvious that you didn't try to compile this code, or you would've found out things like the fact that
return B();
should be
return new B();
and that a constructor method doesn't have the word class in its signature. You would've also found out that when you fix all these problems, your code compiles fine! The .NET compiler is pretty smart; it seems to've been built for dummies in some respects. Not that I'm saying yours is a stupid question-- it definitely isn't. I remember having to change my design once on a Java project due to circular references.
Regards,
Jeff Varszegi
|
|
|
|
|
I have a clock bitmap,and I want to draw the hour hand on the bitmap?
how can i do this?
|
|
|
|
|
Create a Graphics object like this:
Graphics g = Graphics.FromImage ( YourBimap );
and then you can draw text, lines, rectangles, ...
If you do not know anything about this topic look into MSDN for GDI+
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
I have another question.
if I want to show a picture in my aspx file and I want to add some something like line or rectangle beyone the jpeg picture(not the bitmap) before show the jpeg picture,how can i do this?
thank you
|
|
|
|
|
Same way. The Bitmap class represents all images - even indexed images like GIF. See the Image and Bitmap (a derivative of Image ) documentation in the .NET Framework SDK.
For ASP.NET, however, you can't generate an image inline with the page. You must either have a page that sets it's Response.ContentType to something like image/jpeg and output only an image.
This concept is covered in many articles here on CP and MSDN[^], like this article here: An ASP.NET Thumbnail Solution[^]. Many others exist, too - just search this site or google.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
first Thanks a lot to your answer.
But I got error.
the following code:
Bitmap myBitmap = new Bitmap(@"C:\My Documents\My Pictures\GaugeTime.gif");
Graphics g = Graphics.FromImage(myBitmap);
//error is:A Graphics object cannot be created from an image that has an indexed pixel format.
It seems the gif picture is not supported? what should I do?
thank you
|
|
|
|
|
You'll need to save myBitmap to a stream as a different format (the easiest way, though other ways exist - see the .NET Framework SDK for more information about the Bitmap class). You can do this by creating a MemoryStream , saving the Bitmap as a different format, and then get a Graphics object from that:
using (Bitmap myBitmap = new Bitmap(@"C:\...\GaugeTime.gif"))
{
using (MemoryStream ms = new MemoryStream())
{
myBitmap.Save(ms, ImageFormat.Bmp);
ms.Seek(0, SeekOrigin.Begin);
using (Bitmap newBitmap = new Bitmap(ms))
{
using (Graphics g = Graphics.FromImage(newBitmap))
{
}
}
}
} The various using statements just dispose the object when it falls out of scope - even if an Exception is thrown for some reason. Each using statement compiles to the following:
using (Bitmap bmp = new Bitmap(32, 32))
{
}
Bitmap bmp = new Bitmap(32, 32);
try
{
}
finally
{
if (bmp != null) bmp.Dispose();
}
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thank you very much.
I think I understand.
|
|
|
|
|
i got a string in a textBox like this:
"45991476873-0+72396251509/408744738491*408744738491"
please help me to get the result.
thanks.
Mr Duc Linh Nguyen
|
|
|
|
|
|
I have a project that does just that
http://www.codeproject.com/Purgatory/AderEvaluator.asp
|
|
|
|
|
If you’re going to ask someone to do your homework for you the night before it’s due, at least try searching for it online before you post! I will give you a clue; there is an article here on CP that covers this.
- Nick Parker My Blog | My Articles
|
|
|
|
|
SOL huh?
// Steve McLenithan
Cluelessnes: There are no stupid questions, but there are a lot of inquisitive idiots.
|
|
|
|
|
Or maybe we're trying to help you help yourself. You won't learn anything by being given the answer. Do you think the regulars here learned by being told how to do everything? If you don't understand what you're doing, then learn. There's plenty of resources and as Nick said, there's even an article here on CP about Blowfish encryption using C#.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Heath Stewart wrote:
Do you think the regulars here learned by being told how to do everything? If you don't understand what you're doing, then learn.
I completely agree.
// Steve McLenithan
Cluelessnes: There are no stupid questions, but there are a lot of inquisitive idiots.
|
|
|
|
|
I just find it slightly strange that you don't even know where to start and yet you are trying to implement blowfish encryption in C#, the night before none-the-less. Did you find the article here on CP?
- Nick Parker My Blog | My Articles
|
|
|
|
|
http://www.google.ca/search?q=blowfish+encryption+in+c%23&ie=UTF-8&oe=UTF-8&hl=fr&meta=
good old copy and paste homework
|
|
|
|
|
How can I change the line spacing in a chedkedListBox, thanks.
Interlocked
|
|
|
|
|
P/Invoke the SendMessage native API and send the LB_SETITEMHEIGHT (0x01a0) message to the CheckedListBox 's Handle .
If you override CreateParams and set the LBS_OWNERDRAWVARIABLE (0x0020) style, then specify the item index in the WPARAM parameter (3rd parameters to SendMessage ) to set just a single item's height, otherwise the height is set uniformly for all items.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hello there
I have a Winform whit a birth date field that I enter
I want to get Pup up Form Whit a 1 week reminder off all my birth date of all my customers & I want an also 3 day remind & at the same date
Exsmpale : if i enter that Tomi birthdate is in 15/08/1974
i want pupup that remind me in 10/08/2004 in 13/08/2004 in
15/08/2004
how can I do it ?
I am working whit a Accses Database & C#
thanks allot to all...
please help...
|
|
|
|
|
Poll your database every few hours (whatever you like, with a resolution of less than a day to be safe) for birthdays occuring within a certain period, then display those in a form that you can show (using either Show for a modeless dialog or ShowDialog for a modal dialog, but don't forget to dispose the modal Form when you're done using it since it doesn't get disposed automatically in that case).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
do u have code exsample ?
|
|
|
|
|
This is a very simple, entry-level problem and sounds like homework to me. Read about ADO.NET and just use a simple SQL query, which you could test in Access to get it right.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
hey anybody try to use MSHTML.ShowHTMLDialog?
or everybody using AxWebBrowser!
|
|
|
|
|
osto wrote:
hey anybody try to use MSHTML.ShowHTMLDialog?
or everybody using AxWebBrowser!
Ok, whats your problem?
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|