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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:18:48+00:00 2026-05-10T19:18:48+00:00

I am using some custom controls one of which is a tooltip controller that

  • 0

I am using some custom controls one of which is a tooltip controller that can display images, so I am using th ebelow code to instantiate it:

Image newImage = Image.FromFile(imagePath); e.ToolTipImage = newImage; 

obviously could inline it but just testing at the moment. The trouble is the image is sometimes the wrong size, is there a way to set the display size. The only way I can currently see is editing the image using GDI+ or something like that. Seems like a lot of extra processing when I am only wanting to adjust display size not affect the actual image.

  • 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. 2026-05-10T19:18:49+00:00Added an answer on May 10, 2026 at 7:18 pm

    Once you have an image object loaded from its source, the Height and Width (and Size, and all ancillary properties) are read-only. Therefore, you are stuck with GDI+ methods for resizing it in RAM and then displaying it accordingly.

    There are a lot of approaches you can take, but if you were to encapsulate that out to a library which you could reuse should this problem occur again, you’ll be set to go. This isn’t exactly optimized (IE, may have some bugs), but should give you an idea of how to approach it:

    Image newImage = Image.FromFile(myFilePath); Size outputSize = new Size(200, 200); Bitmap backgroundBitmap = new Bitmap(outputSize.Width, outputSize.Height); using (Bitmap tempBitmap = new Bitmap(newImage)) {     using (Graphics g = Graphics.FromImage(backgroundBitmap))     {         g.InterpolationMode = InterpolationMode.HighQualityBicubic;         // Get the set of points that determine our rectangle for resizing.         Point[] corners = {             new Point(0, 0),             new Point(backgroundBitmap.Width, 0),             new Point(0, backgroundBitmap.Height)         };         g.DrawImage(tempBitmap, corners);     } } this.BackgroundImage = backgroundBitmap; 

    I did test this, and it worked. (It created a 200×200 resized version of one of my desktop wallpapers, then set that as the background image of the main form in a scratch WinForms project. You’ll need using statements for System.Drawing and System.Drawing.Drawing2D.

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

Sidebar

Ask A Question

Stats

  • Questions 68k
  • Answers 68k
  • 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
  • added an answer SHOW PROCEDURE STATUS; SHOW FUNCTION STATUS; May 11, 2026 at 12:20 pm
  • added an answer You will need to grant the account running the SQL… May 11, 2026 at 12:20 pm
  • added an answer You need to add a reference to the assembly: Copy… May 11, 2026 at 12:20 pm

Related Questions

I am using some nested layouts in Ruby on Rails, and in one of
I am using some code which was originally taken from the Apple sample ViewTransitions
I am trying to make an Outlook 2003 add-in using Visual Studio 2008 on
I have been assigned a project to develop a set of classes that act

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.