Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Panoramic Bitmap

Posted on 2000-03-07
6
Medium Priority
?
282 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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 220 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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 tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

604 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