Solved

Panoramic Bitmap

Posted on 2000-03-07
6
246 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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 demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

930 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

10 Experts available now in Live!

Get 1:1 Help Now