Solved

Panoramic Bitmap

Posted on 2000-03-07
6
272 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Adapt this command to show who installed 29 113
unable to delete all specified values regedit 38 874
zeroFront challenge 7 134
Adjust the codes 3 63
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

739 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