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

Related Questions

I am trying to dynamically create a Bitmap Image using byte array using following
iOS beginner here. I'm using the following code to save my facebook accessToken and
Using the TinyCarousel program I created the following sample page. http://www.dealred.com/wa/jqimage.htm The carousel is
I'm using the following code to resize a tif. The tif has an alpha
i was working with navigation bar button items.i was using the following code to
I have written the following IronPython code: import clr clr.AddReference(System.Drawing) from System import *
I am trying to convert a PIL image into an array using NumPy. I
I have created own AMI and registered it on Amazon EC2. But while AMI
I need to display in image on the view this way <img src =
I have some code that continuously generates UIImage frames for animation. Currently I am

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.