Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8973901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:33:14+00:00 2026-06-15T18:33:14+00:00

I am Resizing a Image and add watermark to image. And Return the image.

  • 0

I am Resizing a Image and add watermark to image. And Return the image. Here is my code.

Image resizedImage = ResizeImage(original6, new Size(500, 375));

Re size function:

public static System.Drawing.Image ResizeImage(System.Drawing.Image image, Size size)
{
    int newWidth;
    int newHeight;
    if (true)
    {
        int originalWidth = image.Width;
        int originalHeight = image.Height;
        float percentWidth = (float)size.Width / (float)originalWidth;
        float percentHeight = (float)size.Height / (float)originalHeight;
        float percent = percentHeight < percentWidth ? percentHeight : percentWidth;
        newWidth = (int)(originalWidth * percent);
        newHeight = (int)(originalHeight * percent);
    }
    else
    {
        newWidth = size.Width;
        newHeight = size.Height;
    }
    System.Drawing.Image newImage = new Bitmap(newWidth, newHeight);
    using (Graphics graphicsHandle = Graphics.FromImage(newImage))
    {
        graphicsHandle.InterpolationMode = InterpolationMode.HighQualityBicubic;
        graphicsHandle.DrawImage(image, 0, 0, newWidth, newHeight);
    }


    System.Drawing.Bitmap bitmapimage = new System.Drawing.Bitmap(newImage, size.Width, size.Height);// create bitmap with same size of Actual image
    System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bitmapimage);

    SolidBrush brush = new SolidBrush(Color.FromArgb(113, 255, 255, 255));
    //Adding watermark text on image
    g.DrawString("My watermark", new Font("Arial", 16, FontStyle.Bold), brush, 5, 100);

    return bitmapimage;
}

I am retrieve the new re sized image with watermark and going to save as new image file.

resized6.Save(Server.MapPath(sSavePath + ownerRef + "Pic6v2" + ".jpg"));

This is working fine. However I can’t control the file size.
When my original JPG is only 45kb but when my new re-sized image is 500kb. How can I reduce the file size.?
info: original resolution (400×300 px) and new image (500x375px)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:33:15+00:00Added an answer on June 15, 2026 at 6:33 pm

    I don’t remember this off the top of my head, but file size generally has to do with JPEG quality settings. You also need to make sure it’s saved as an actual jpg, not a bitmap, which I don’t see that you’re doing..

    See also: C# Simple Image Resize : File Size Not Shrinking

    JPEG Quality settings:
    http://msdn.microsoft.com/en-us/library/bb882583.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I add constraints to image resizing code? I want the image to
Im trying to add a watermark to processed images with below code I got
This is driving me crazy, so... When resizing image to small thumbnail, resulting image
I'm using this php class ( http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php ) for creating the different sized images
I am using the iPhone camera to capture an image and them resizing and
I have photo gallery code that does image re-sizing and thumbnail creation. I use
I am uploading a image file to the server and resizing it to save
I'm a php noob and trying to create a image resizing script that will
Possible Duplicate: Image size got bigger when trying to reduce its size What I
Hello I build a script that does image uploading and resizing and it all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.