Click here to Skip to main content
16,005,048 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to remove the control box (The 3 buttons of a window at the top right corner) of a MDI Form? Pin
Stefan Troschuetz6-Dec-04 1:11
Stefan Troschuetz6-Dec-04 1:11 
AnswerRe: How to remove the control box (The 3 buttons of a window at the top right corner) of a MDI Form? Pin
Stanciu Vlad6-Dec-04 4:35
Stanciu Vlad6-Dec-04 4:35 
Generalhelp! Serializable Pin
chinimimita5-Dec-04 22:34
chinimimita5-Dec-04 22:34 
GeneralSave Drawing C# Pin
mathon5-Dec-04 22:20
mathon5-Dec-04 22:20 
GeneralRe: Save Drawing C# Pin
DavidNohejl6-Dec-04 0:06
DavidNohejl6-Dec-04 0:06 
GeneralRe: Save Drawing C# Pin
mathon6-Dec-04 3:01
mathon6-Dec-04 3:01 
GeneralRe: Save Drawing C# Pin
DavidNohejl6-Dec-04 10:44
DavidNohejl6-Dec-04 10:44 
GeneralRe: Save Drawing C# Pin
mathon6-Dec-04 5:45
mathon6-Dec-04 5:45 
Hello,

I tried it with something like that:

public void DrawStringRectangleF(int a, int b, int c, int d, System.Drawing.Color color, string text)
{
Bitmap bmp = new Bitmap(1400,1000);
Graphics g = Graphics.FromImage(bmp);

System.Drawing.SolidBrush myBrush = new System.Drawing.SolidBrush(color);
System.Drawing.Graphics formGraphics = this.CreateGraphics();
String drawString = text;
// Create font and brush.
Font drawFont = new Font("Verdana", 8);
SolidBrush drawBrush = new SolidBrush(Color.White);
// Create rectangle for drawing.
int x = a;
int y = b;
int width = c;
int height = d;
Rectangle drawRect = new Rectangle( x, y, width, height);
// Draw rectangle to screen.
Pen blackPen = new Pen(Color.Black);
//e.Graphics.DrawRectangle(blackPen, x, y, width, height);
g.FillRectangle(myBrush,drawRect);

GraphicsUnit units = GraphicsUnit.Pixel;
g.DrawString(drawString, drawFont, drawBrush, drawRect);

bmp.Save("filename.bmp");
}

But that does not work. The bmp-file is created but nothing in it. And when I want to open the file, an error occurs that the format is incorrect. Does anbody know what went wrong?? Frown | :(

patrick
GeneralRe: Save Drawing C# Pin
DavidNohejl6-Dec-04 10:51
DavidNohejl6-Dec-04 10:51 
GeneralAccessing webform controls in class Pin
Nilesh Hapse5-Dec-04 22:09
Nilesh Hapse5-Dec-04 22:09 
Generaldisplay data in datagrid using the datareader Pin
steve_rm5-Dec-04 19:26
steve_rm5-Dec-04 19:26 
GeneralRe: display data in datagrid using the datareader Pin
Daniel Turini5-Dec-04 20:22
Daniel Turini5-Dec-04 20:22 
QuestionHow do you map a network drive? Pin
SeanV5-Dec-04 19:25
SeanV5-Dec-04 19:25 
AnswerRe: How do you map a network drive? Pin
Daniel Turini5-Dec-04 20:24
Daniel Turini5-Dec-04 20:24 
GeneralDB and Several Systems Pin
mkomasi5-Dec-04 18:49
mkomasi5-Dec-04 18:49 
GeneralRe: DB and Several Systems Pin
Daniel Turini5-Dec-04 20:20
Daniel Turini5-Dec-04 20:20 
GeneralFind file status in C# Pin
mmsspp5-Dec-04 18:48
mmsspp5-Dec-04 18:48 
GeneralRe: Find file status in C# Pin
Daniel Turini5-Dec-04 20:15
Daniel Turini5-Dec-04 20:15 
Questionhow to do: Pin
mansoorafzal5-Dec-04 18:35
mansoorafzal5-Dec-04 18:35 
AnswerRe: how to do: Pin
Jay Shankar5-Dec-04 21:32
Jay Shankar5-Dec-04 21:32 
AnswerRe: how to do: Pin
Dave Kreskowiak6-Dec-04 4:15
mveDave Kreskowiak6-Dec-04 4:15 
GeneralCRAP!!!! Pin
tom_dx5-Dec-04 16:14
tom_dx5-Dec-04 16:14 
GeneralRe: CRAP!!!! Pin
Christian Graus5-Dec-04 16:19
protectorChristian Graus5-Dec-04 16:19 
GeneralRe: CRAP!!!! Pin
tom_dx5-Dec-04 16:29
tom_dx5-Dec-04 16:29 
GeneralRe: CRAP!!!! Pin
Christian Graus5-Dec-04 16:31
protectorChristian Graus5-Dec-04 16:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.