none
To improve the graphics in our projects RRS feed

  • Question

  • Hello, ladies and gentlemen!

    I wish everybody a good  work!!!

    How create graphics and save its on the disk, please?

    For example, i can the object by name Graphics, but cannot to save it on my disk as the file.

    Thank you everybody who will answer me!

    Wednesday, December 20, 2017 1:29 PM

All replies

  • Please provide more information including what UI framework you're using and what you mean by a graphic so we can move this to the correct forum.

    Michael Taylor http://www.michaeltaylorp3.net

    Thursday, December 21, 2017 4:01 PM
    Moderator
  • Hi R1979,

    >>How create graphics and save its on the disk, please?

    If you only want to create graphics and save it on the disk, you could use Bitmap to achieve it. like this:

    Bitmap bitmap = new Bitmap(Convert.ToInt32(1024), Convert.ToInt32(1024), System.Drawing.Imaging.PixelFormat.Format32bppArgb);
    Graphics g = Graphics.FromImage(bitmap);
    // Add drawing commands here
    g.Clear(Color.Green);
    bitmap.Save(@"C:\Users\picturename.png", ImageFormat.Png);

    Best regards,

    Zhanglong Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, December 25, 2017 7:33 AM
    Moderator
  • Hi R1979,

    Any Update? Could you please provide more information about the issue you are facing?

    Also it will be very helpful for us to provide a code snippet to show show what you have done so far, this will help us to point out where you are going wrong.


    Thanks,
    Sabah Shariq

    [If a post helps to resolve your issue, please click the "Mark as Answer" of that post or click Answered "Vote as helpful" button of that post. By marking a post as Answered or Helpful, you help others find the answer faster. ]

    Monday, December 25, 2017 1:17 PM
    Moderator