Solved

Panoramic Bitmap

Posted on 2000-03-07
6
236 Views
Last Modified: 2013-11-20
I have a bitmap that is a panarama of an area.  I would like to display part of the picture in a dialog box (not as the background) and allow the user to scroll left and right to view the different perspectives of the panorama.

I would also like to allow the user to change panarama bitmaps.

Is this possiable?

Thanks.
Brandy.
0
Comment
Question by:Infinger
  • 4
  • 2
6 Comments
 

Author Comment

by:Infinger
ID: 2594141
Adjusted points to 110
0
 
LVL 9

Expert Comment

by:ShaunWilde
ID: 2594727
yes

BitBlt your bitmap twice into its own DC

ie if bitmap is 'ABC' (imagine this is the picture) then you would have 'ABCABC'

then depending on your view position you can then BitBlt onto your ScreenDC (the one that the user sees)

pos1 'ABC'
pos2 'BCA'
pos3 'CAB'
pos4==pos1 = 'ABC'

okay I know it is a bit of a simple example but I hope you get the idea
0
 

Author Comment

by:Infinger
ID: 2605937
I'm very new to anything concerning images.  I need an example of how to use BitBlt to insert a picture in a dialog box.

I have the bitmaps loaded into a resource only dll. Currently I have a m_Bitmap image on the dialog that I just setbitmap on.

I also have a DIBSectionLite class that I downloaded from codeguru.  The problem is that I don't know what the pDC should be for the dialog box.... and I'm not at all familar with CDC's.

Thanks.

0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:Infinger
ID: 2605944
I'm very new to anything concerning images.  I need an example of how to use BitBlt to insert a picture in a dialog box.

I have the bitmaps loaded into a resource only dll. Currently I have a m_Bitmap image on the dialog that I just setbitmap on.

I also have a DIBSectionLite class that I downloaded from codeguru.  The problem is that I don't know what the pDC should be for the dialog box.... and I'm not at all familar with CDC's.

Thanks.

0
 
LVL 9

Accepted Solution

by:
ShaunWilde earned 110 total points
ID: 2607209
the easiest way is to override your OnPaint handler of your dialog - this will provide you with a DC you can use.

I am not familiar with the DIBSectionLite clas from code guru so the following code is if you are using a CBitmap (m_bmpBackground)
the following code will insert a previuosly loaded bitmap at 0,0 of your dialog. you will need to adjust the settings to BitBlt to set the location and

void CYourDialog::OnPaint()
{

      CPaintDC dc(this); // device context for painting
      BITMAP bmInfo;

      m_bmpBackground.GetObject(sizeof(BITMAP),&bmInfo);

      CRect BitmapRect(0,0,bmInfo.bmWidth,bmInfo.bmHeight);

      CBitmap *pOldBmp;

      CDC dcTemp;

      dcTemp.CreateCompatibleDC(pDC);

      pOldBmp = dcTemp.SelectObject(&m_bmpBackground);

      pDC->BitBlt(0,0,BitmapRect.Width(),BitmapRect.Height(),
                              &dcTemp,0,0,SRCCOPY);

      dcTemp.SelectObject(pOldBmp);
      // Do not call CDialog::OnPaint() for painting messages
}

0
 

Author Comment

by:Infinger
ID: 2608942
I got it.

THANKS.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now