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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:41:56+00:00 2026-05-13T08:41:56+00:00

I am using the following code to save an image created on a Form

  • 0

I am using the following code to save an image created on a Form to a bitmap file:

SavePicture Form1.Image, Output_Dir + Patternname + ".bmp"
DoEvents   

Now the image created on the form is a 1600×1200 pixel image (which looks correct);
however, when I save the file using the above code the image is always saved as a 1920×1200 pixel bitmap.

1920×1200 is the current resolution of my screen.

Here is the code used to set the width/height of the form image:

Form1.ScaleMode = vbPixels 
Form1.AutoRedraw = True
W = 1600
H = 1200
Form1.Width = W * Screen.TwipsPerPixelX
Form1.Height = H * Screen.TwipsPerPixelY
Form1.Show

I cannot seem to understand why the form image looks correct at 1600×1200, yet when I save the program adds an extra white block of 320X1200 to make the bitmap 1920×1200.

  • 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-05-13T08:41:56+00:00Added an answer on May 13, 2026 at 8:41 am

    I see you’re setting the size of the form Form1. You need to be changing the size of a picturebox on the form. Make sure you have a PictureBox control (“Picture1”) on your form, and try this:

    Picture1.ScaleMode = vbPixels ' Set scale to pixels.
    Picture1.AutoRedraw = True    ' If needed
    
    Picture1.Width = W   ' in pixels
    Picture1.Height = H  ' in pixels
    

    Then save it with this:

    SavePicture Picture1.Image, Output_Dir + Patternname + ".bmp"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 269k
  • Answers 269k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I think you should write this in .m file static… May 13, 2026 at 1:22 pm
  • Editorial Team
    Editorial Team added an answer I would recommend separating your data access layer from your… May 13, 2026 at 1:22 pm
  • Editorial Team
    Editorial Team added an answer try changing the onkeyup event on the input to return… May 13, 2026 at 1:22 pm

Related Questions

I am trying to save images using the following code: - (void)writeData{ if(cacheFileName==nil) return;
I have a flex 3 application that creates an Image from a canvas which
I am trying to render some XAML at runtime. My XAML is dynamically constructed
I am using Microsoft's CDO (Collaboration Data Objects) to programmatically read mail from an
Simple question regarding data persistance between application sessions. My application allows the user to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.