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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:23:42+00:00 2026-05-30T02:23:42+00:00

A View in our legacy application is displaying an image using StretchDIBits. In case

  • 0

A View in our legacy application is displaying an image using StretchDIBits. In case you are not familiar with StretchDIBits, it is used to display an image with given size to another size on MFC View. For example, an image of size (128,120) can be displayed on (512,512) with the function.

In simple condition where width or height of display is multiple of that of the image, I can calculate location of a pixel in original image from location of the display without problem. But in the other case, I think I need to know how StretchDIBits distributes pixels from original image to display rectangle of given size, especially when there is no multiples between sizes of the two.

  • 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-30T02:23:44+00:00Added an answer on May 30, 2026 at 2:23 am

    I don’t know how StretchDIBits maps input pixels to output pixels, and I suspect it’s subject to change at Microsoft’s whim anyway.

    Create an image the same size as your input, and fill the pixels with incrementing values: (0,0) gets RGB(0,0,0), (0,1) gets RGB(0,1,0), (10,20) gets RGB(10,20,0), etc. Create a memory DC the same size as your output and use StretchDIBits to draw the image into it. Now every pixel in that DC can be mapped back to the input by the color it contains.

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

Sidebar

Related Questions

A certain form in our application displays a graphical view of a model. The
Third party vendors using our software as a component view Windows Logo Certification as
We have some images in our database and want to display their in view.
<%= Math.Round(keyRate, 5) %> So in our view, we use this to display a
I've created a c# webservice that allows our front end support teams to view
My view-state to action-state transition does not appear to be happening. In the following
By 'view' here I mean different combinations of properties of the model, not the
Our model has public DateTime date { get; set; } . In our view,
I want to create a tableviewcell and add it on the view(not tableview) as
For legacy reasons, I'm using CVS on a project. Recently I committed some changes

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.