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

  • Home
  • SEARCH
  • 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 8760265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T15:00:19+00:00 2026-06-13T15:00:19+00:00

I have this code: int ISampleGrabberCB.BufferCB(double sampleTime, IntPtr pBuffer, int bufferLen) { if (Form1.ExtractAutomatic

  • 0

I have this code:

int ISampleGrabberCB.BufferCB(double sampleTime, IntPtr pBuffer, int bufferLen)
        {

            if (Form1.ExtractAutomatic == true)
            {
                using (var bitmap = new Bitmap(_width, _height, _width * 3, PixelFormat.Format24bppRgb, pBuffer))
                {
                    if (!this.Secondpass)
                    {
                        long[] HistogramValues = Form1.GetHistogram(bitmap);
                        Form1.Histograms.Add(HistogramValues);
                        long t = Form1.GetTopLumAmount(HistogramValues, 1000);
                        Form1.averagesTest.Add(t);

                    }
                    else
                    {

                        if (_frameId > 0)
                        {
                            double t = Form1.averagesTest[_frameId] / 1000.0 - Form1.averagesTest[_frameId - 1] / 1000.0;
                            w.WriteLine("averagesTest >>>  " + t);
                            if (_frameId == 1049)
                            {
                                w.Close();
                            }
                            if (Form1.averagesTest[_frameId] / 1000.0 - Form1.averagesTest[_frameId - 1] / 1000.0 > 60.0)                                {
                                count = 6;
                            }

                            if (count > 0)
                            {
                                bitmap.RotateFlip(RotateFlipType.Rotate180FlipX);
                                bitmap.Save(Path.Combine(_outFolder, _frameId.ToString("D6") + ".jpg"),ImageFormat.Jpeg);
                                count --;
                            }

Before that i SAved the bitmap as Bitmap .bmp now i changed it to Jpeg .jpg but is there anyway to change the jpg to be saved in a lower resolution ? Maybe manual change somehow ?

bitmap.Save(Path.Combine(_outFolder, _frameId.ToString("D6") + ".jpg"),ImageFormat.Jpeg);

Instead saving it as just jpeg maybe to save it as jpeg but with a much lower resolution.
The reason is that i want to show each Bitmap Histogram and also to show in the same time the image/frame it self in the pictureBox but i if i will be able to save it in lower resolution the saving process will be faster.

Since i want to check the histograms i dont mind if the images/frames will be show in a low resolution in this case.

  • 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-13T15:00:21+00:00Added an answer on June 13, 2026 at 3:00 pm

    Resolution has no effect at all on the saved image file. It is a reference number, it indicated how large the image was (in inches) on the device that created the image.

    It gets to be important when you display an image on a device that has a radically different resolution. A good example would be an image that you created in a paint program on your machine. And then print on paper.

    In your paint program you’d create, say, an image of 1600 x 900 pixels and it filled the entire screen of your laptop, all 14 inches of it. If you then print it on a printer with a 600 dots-per-inch resolution then that same image would be 1600/600 x 900/600 = 2.7 x 1.5 inches. It turned into a postage stamp on paper.

    To avoid that, the image has be rescaled so it also takes 14 inches on paper. The resolution reference number in the image permits this rescaling. Your paint program recorded the resolution of your monitor, say 120 dots per inch. When you print it and see the printer has a 600 dots per inch resolution, you know you’ll need to print the image 5 times as big to get it the same size on paper.

    To get the image to save faster you need to make it smaller. In pixels. The Bitmap(Image, Size) constructor is a simple way to do that.

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

Sidebar

Related Questions

I am working on network programming using epoll and I have this code... int
I am using gdb to debug a C++ program. I have this code: int
I have this code: int se = (int) settings.GruppoSegreteria; var acc = db.USR_Accounts.Where( p
Ok I currently have this code public int i = 0; //this is outside
I have this code: class MyObj { int Id; string Name; string Location; }
For Andriod I have this code: public Tank(int color) { bounds = new RectF();
I have this simple piece of code : int a = 1, b =
I have this code: //choosed a picture public void onActivityResult(int requestCode, int resultCode, Intent
I have this code: pid_t vPid=fork(); int vStat; switch(vPid){ case -1: perror(fork); exit(1); case
Hello I have this code class Triplets { public: int nVal1; int nVal2; NodeT

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.