In the fixed-size window ( or dialog box ) to display the full image (BMP, JPG ...)! - Graphics Processing/Algorithm - VC/MFC - Program Forge (C/C++, Delphi, Linux/Unix, MS-SQL Server, VC/MFC)
In the fixed-size window ( or dialog box ) to display the full image (BMP, JPG ...)!
Author: Nicole4846 Date:
Nicole4846
The first program to write the image , how in the fixed-size window ( or dialog box ) complete image is displayed within (BMP, JPG ...)! It is best to give the code
LoadImageStretchBlt
# define & STRECH_1_1 0# define & STRECH_FULL_X 1# define & STRECH_FULL_Y & & & 2# define & STRECH_FULL 3# define & STRECH_CENTER & & & 4class & CImgWnd &: & public & CStatic{// & Constructionpublic:CImgWnd ();void & SetImage (UINT & resID);void & SetStrechType (int & nStrechType);// & Attributesprotected:CBitmap & m_bmpIint & m_nStrechTCRect & m_rcSCRect & m_rcD// & Operationspublic:// & Overrides// & ClassWizard & generated & virtual & function & overrides/ / {{AFX_VIRTUAL (CImgWnd)//}} AFX_VIRTUAL// & Implementationpublic:void & SetImage (CString & FileName);virtual & ~ CImgWnd ();// & Generated & message & map & functionsprotected:// {{AFX_MSG (CImgWnd)afx_msg & void & OnPaint ();//}} AFX_MSGDECLARE_MESSAGE_MAP ()};# include & & stdafx.h include & & ImgWnd.h ifdef & _DEBUG# define & new & DEBUG_NEW# undef & THIS_FILEstatic & char & THIS_FILE [] & = & __ FILE__;#endif//////////////////// ////////////////////////////////////////////////// ///////// & CImgWndCImgWnd :: CImgWnd (){m_nStrechType & = & STRECH_FULL;}CImgWnd :: ~ CImgWnd (){}BEGIN_MESSAGE_MAP (CImgWnd, & CStatic)// {{ AFX_MSG_MAP (CImgWnd)ON_WM_PAINT ()//}} AFX_MSG_MAPEND_MESSAGE_MAP ()/////////////// ////////////////////////////////////////////////// ////////////// & CImgWnd & message & handlersvoid & CImgWnd :: SetImage (UINT & resID){m_bmpImage .LoadBitmap (resID);}void & CImgWnd :: SetImage (CString & FileName){HBITMAP & hBitmap = (HBITMAP) :: LoadImage ( AfxGetInstanceHandle (), FileName, IMAGE_BITMAP, 0,0, LR_CREATEDIBSECTION | LR_LOADFROMFILE | LR_DEFAULTSIZE);!ASSERT (hBitmap = NULL);& & & & m_bmpImage.Attach (hBitmap);}void & CImgWnd :: SetStrechType (int & nStrechType){m_nStrechType & = & nStrechT// repaintInvalidate ();}void & CImgWnd :: OnPaint () &{CPaintDC & dc (this); & // & device & context & for & painting// receive window sizeCRect &GetClientRect (& r);// fill the backgroundHBRUSH & brush & = & (HBRUSH) :: GetStockObject (GRAY_BRUSH); &:: FillRect (dc.m_hDC, & r, brush);dc. SetStretchBltMode (HALFTONE);// bitmap selected into the device context inCDC &memdc.CreateCompatibleDC (& & dc &);CBitmap * & pOldBmp = & memdc.SelectObject (& m_bmpImage);// get bitmap parametersBITMAP &m_bmpImage.GetBitmap (& bmp);// start scalingswitch (m_nStrechType){case & STRECH_1_1: // 1: 1dc.BitBlt (r .left, r.top, r.Width (), r.Height (), & memdc, 0,0, SRCCOPY);case & STRECH_FULL_X: // by widthdc.StretchBlt(r.left,r.top,r.Width(),bmp.bmHeight,&memdc,0,0,bmp.bmWidth, bmp.bmHeight, SRCCOPY);case & STRECH_FULL_Y: // by highlydc.StretchBlt (r.left, r.top, bmp.bmWidth, r.Height (), & memdc, 0,0,bmp.bmWidth, bmp.bmHeight, SRCCOPY);case & STRECH_FULL: // full windowdc.StretchBlt (r.left, r.top, r. Width (), r.Height (), & memdc, 0,0,bmp.bmWidth, bmp.bmHeight, SRCCOPY);case & STRECH_CENTER: // center display size of the window is halfdc.StretchBlt (r.Width () / 4, r.Height () / 4, r.Width () / 2, r.Height () / 2, & memdc , 0,0,bmp.bmWidth, bmp.bmHeight, SRCCOPY);}// reductionmemdc.SelectObject ( pOldBmp);}
CImgWnd & m_& m_bmpimg.SetImage (szPathName);m_bmpimg.SetStrechType(STRECH_FULL);I used a STATIC control to display
cfy_chinesefeng
VC novices learn learn !
you used the popular online dynamic display gif of PictureEx class ? You can be a static control in dialog , then build PictureEx class of an object , alluding to this control on it, you want , then you can write to mefix the picture full 十九关,象棋_百度知道Thanks to monoform for pointing out that most of the galleries in our
area did not have their fullsize images working.
This was due to a flaw in a regular expression which has now been fixed.
Sorry about that folks.
| Submitted by: quartz -
on: Tuesday, 24th January 2006 at 19:06:30 GMT
Rating: 4.00/1 vote(s)
Why not share your thoughts on this article by granting it a rating out of 5 stars.
You can edit your rating at any time by re-visiting this page and re-rating the content or, if you are a site member, through
your control panel.
Click the link or image above to view the .
The gallery contains 2 images of this figure for your viewing pleasure.
Hasbro Inc submitted a trademark application for
with the USPTO on the Tuesday, 23rd September 2003.
The mark was submitted within the category
toy action figures, toy vehicles and toy robots convertible into other visual toy forms and accessories for use therewith and currently has as status of Abandoned because no Statement of Use or Extension Request timely filed after Notice of Allowance was issued.
To view all documents in this file, click on the Trademark Document Retrieval link at the top of this page..
Ron Friedman (one of the head writers for the first two seasons of Transformers Generation One and Transformers: The Movie) has placed several auctions on the website .& The auctions include the G1 series bible, character sheets
We loved the Transformers Choose Your Fate books as kids, and even wrote a text adventure in their style for an old version of Transformers At The Moon.
Here you can find images from these puzzle-books, both UK and US
A lengthly transformation sequence showing Megatron transforming from his Earthern helicopter mode into robot form, taking from the episode Megatron Rising Part Two. ....
We loved the Transformers Choose Your Fate books as kids, and even wrote a text adventure in their style for an old version of Transformers At The Moon.
Here you can find images from these puzzle-books, both UK and US
The scans contained within this gallery are taken from our own Transformers toysheet collection.
This is the first US Transformers toysheet. ....
The instruction scans contained within this gallery with the TF08.net watermark were originally from the Chinese TF08 website.
They have been added here as a mirror. ....
of this website for the members only features.
To become a
member, visit the .
Transformers At The Moon is a fan created website regarding those Robots In Disguise from Hasbro Inc and TakaraTomy
better known as The Transformers.
This website was established in October 1999 and has been running ever since.
You can use Transformers At The Moon for such things as transformers toys,transformers figures,transformers movie,optimus prime,megatron,bumblebee,unicron,transformers cartoon,transformers comicsTransformers Toys - Transformers At The Moon - www.transformertoys.co.uk
New Topics
By quartzBy quartzBy quartzBy quartzBy quartzBy quartzBy quartzBy quartzBy quartzBy quartz
Latest Discussion
By quartzBy quartzBy quartzBy quartzBy quartzBy quartzBy quartzBy quartzBy quartzBy quartz