Solved

Panoramic Bitmap

Posted on 2000-03-07
6
255 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
iSeries FTP Exit Program 8 136
ORA-01403: no data found 43 101
method notes when mouse over in eclipse 5 87
x-bar in Google Sheets 2 55
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

809 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