Click here to Skip to main content
15,905,028 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have used following code it did not work. I do not know where i am wrong.


Response.Clear();
       int height =500;
       int width = 500;
       Random r = new Random();
       int x = r.Next(500);

       Bitmap bmp = new Bitmap(width, height, PixelFormat.Format32bppPArgb);
       Graphics g = Graphics.FromImage(bmp);
       g.SmoothingMode = SmoothingMode.AntiAlias;
       //g.TextRenderingHint = TextRenderingHint.AntiAlias;
       g.Clear(Color.Green);
       System.Threading.Thread.Sleep(5000);
       System.Drawing.Pen p = new System.Drawing.Pen(System.Drawing.Color.Red);

       System.Drawing.Pen p1 = new System.Drawing.Pen(System.Drawing.Color.Blue);

       System.Drawing.Brush background=new System.Drawing.SolidBrush(System.Drawing.Color.Violet);

       System.Drawing.Brush background1 = new System.Drawing.SolidBrush(System.Drawing.Color.Red);

       //g.FillEllipse(background, 0, 0, 100, 100);

       //g.FillPie(background, 100, 100, 100, 100, 0, 90);

     //  g.FillRectangle(background, 0, 100, 200, 50);

      // g.DrawRectangle(p1, 0, 0, 300, 300);

       g.DrawString("maneesh", new Font("Arial", 12, FontStyle.Italic), background1, new PointF(100, 50));
      // g.DrawBezier(p,new PointF(0, 0),new PointF(10, 70),new PointF(100, 100),new PointF(200, 250));
       //
       bmp.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
     //  bmp.Save(Response.OutputStream, ImageFormat.Jpeg);
       g.Dispose();
       bmp.Dispose();
       Response.End();
Posted
Comments
Herman<T>.Instance 16-Feb-12 6:20am    
what do you see?
maneesh katiyar 16-Feb-12 6:36am    
I see some following characters on the screen.



<pre>����JFIF


``��C    $.' ",#(7),01444'9=82<.342��C
 2!!22222222222222222222222222222222222222222222222222��

�
"

��







 ���

}
!1AQa"q2���#B��R��$3br� %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz���������������������������������������������������������������������������










 ���

w
!1AQaq"2�B���� #3R�br� $4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz�������������������������������������������������������������������������� 
?⨢���Š(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(����}�ڶ�u���Vײ��FQE��RR�^�5�t���T���.� (��O��q��{��ukOu���[N�Q@�X��5w{�f�V�}��Z�k�r�(����()FW��5uk��~�w�(����(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(��(*3�SQv��7���QE��W���Zu}-o��ދ�QE�cɤ�ߧo���EPZ�WO�M�m�݂�(��U%$���� �%�QA
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP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EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
EP
E

1 solution

 
Share this answer
 
Comments
maneesh katiyar 16-Feb-12 6:38am    
thanks it,s a better solution for me

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900