HexEdit/PrevwView.cpp
double CPrevwView::zoom_fit()
{
	CHexEditDoc *pDoc = GetDocument();
	ASSERT(pDoc != NULL);

	// Get size of the display area (client area of the window)
	CRect rct;
	GetClientRect(&rct);

	// Get dimensions of the bitmap (as double so we can calculate zoom)
	double bmwidth  = pDoc->preview_width_;
	double bmheight = pDoc->preview_height_;

	return max(bmwidth/rct.Width(), bmheight/rct.Height());
}
// Calculate zoom level where the bitmap just fits inside the display

Calculate zoom level where the bitmap just fits inside the display
Calculate zoom level where the bitmap just fits inside the display
double CPrevwView::zoom_fit()
{
	CHexEditDoc *pDoc = GetDocument();
	ASSERT(pDoc != NULL);
	CRect rct;
	GetClientRect(&rct);
	double bmwidth  = pDoc->preview_width_;
	double bmheight = pDoc->preview_height_;
	return max(bmwidth/rct.Width(), bmheight/rct.Height());
}
double CPrevwView :: zoom_fit ( ) { CHexEditDoc * pDoc = GetDocument ( ) ; ASSERT ( pDoc != NULL ) ; CRect rct ; GetClientRect ( & rct ) ; double bmwidth = pDoc -> preview_width_ ; double bmheight = pDoc -> preview_height_ ; return max ( bmwidth / rct . Width ( ) , bmheight / rct . Height ( ) ) ; }
Calculate zoom level where the bitmap just fits inside the display
Calculate zoom level where the bitmap just fits inside the display
// Get size of the display area (client area of the window)
 // Get dimensions of the bitmap (as double so we can calculate zoom)
