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 8795831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:28:36+00:00 2026-06-13T23:28:36+00:00

Few days ago I asked this question and got the answer: How to add

  • 0

Few days ago I asked this question and got the answer:
How to add a picture frame and insert the text in the image?

Now, when I save content from TPanel (1x shape, 1x TImage, 2x TLabel) as JPG file,
size of that JPG file is increased from 20kb, wich is size of picture in TImage, to 620kb.

Dimensions are almost same. Original JPG file 320×320, new JPG picture 361×440.

So, how to reduce that size?

This is answer for first question, from @iPath, so that is how new JPG file is created:

procedure TForm1.SavePanelAsImage;
var
 img: TBitmap;
begin
 img := TBitmap.Create;
 try
  img.Width := fpPanel.Width;
  img.Height := fpPanel.Height;
  fpPanel.PaintTo(img.Canvas, 0, 0);
  img.SaveToFile(fpFileName);
 finally
  img.Free;
end;
end;
  • 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-13T23:28:38+00:00Added an answer on June 13, 2026 at 11:28 pm

    What you have saved is not a JPEG image. You have saved a Windows bitmap. That has no compression at all. It happens to have the .jpg extension, but that doesn’t make the file itself be a JPEG.

    You need to use TJPEGImage to save the file. Control the compression by using the CompressionQuality property. Once you have your image in a bitmap, transfer it to a JPEG

    uses
      jpeg;
    
    procedure TForm1.SavePanelAsImage;
    var
      img: TBitmap;
      JpegImage: TJPEGImage;
    begin
      img := TBitmap.Create;
      try
        img.Width := fpPanel.Width;
        img.Height := fpPanel.Height;
        fpPanel.PaintTo(img.Canvas, 0, 0);
        JpegImage := TJPEGImage.Create;
        try
          JpegImage.CompressionQuality := ...;//you decide the value
          JpegImage.Assign(img);
          JpegImage.SaveToFile(fpFileName);
        finally
          JpegImage.Free;
        end;
      finally
        img.Free;
      end;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A few days ago I asked this question about jquery ajax function invoking action
A few days ago i asked this question: Displaying images from Facebook photo albums
I asked a pretty similar question a few days ago, but this one is
I asked this question a few days ago, and I didn't get a lot
I originally asked this question on the Highcharts forum a few days ago but
A few days ago, this was my question, and I found the answer. Maybe
I asked a question almost identical to this a few days ago via this
I asked a question a few days ago about how to customise the calendar
A few days ago I posted this question and everyone suggested me to use
I had asked this question in a much more long-winded way a few days

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.