|
you can modify
BOOL CPictureShowDoc::CreateFilesList() to solve crash problem:
after line
m_FilesList.GetHeadPosition();
insert the follow two lines
if (m_Finding)
m_Finding = m_Finder.FindNextFile();
|
|
|
|
|
Hi Yovav!!!
I`m Cristian, I`m the guy who is performing the proyect of "displaying
images" (CODE PROYECT Web Site). I want to thank you your help an your
advices but I couldn`t obtain the image showned in the picture...well
Now I have other problem which I need to solve and I want to know if you can
give me an idea or advice.
I need to take a photo from a web cam,in this case the program can do it
already, it make it when a button of the aplication is pushed with the
mouse. But now, I need that the photo be taken for an external signal, I
mean from the parallel port or serial port...is it correct???
Do you know if there is a class or funtion which can handle the parallel, or
serial port???
Thanks and best Regards.
Waiting for your response CRISTIAN
If yo want I can send you the program, it`s good but it`s only for logitech
WebCams.
|
|
|
|
|
I did not mess with that stuff yet,
check out the www.CodeGuru.com forums...
Best Regards - Yovav Gad
EMail: Dev@SuperMain.com
Web-Site: www.SuperMain.com
|
|
|
|
|
Hi Yovav!!!
I`m relly very thankful for your faster response, I have made as you suggest, but as I said before, I´m beginner in VC++, and I thought that I didn`t follow your instruction correctly...(I don`t know why I taken this trouble!!! ).
Any way, here is the piece of code that I modified, and one more time thaks for your attention.
By the way..your website is genial!!!!
NOTE.- If you have time, Could I send you the complete program, it`s too good, only miss the part to shown the image stored. and I hope that you can help me whit this. Waiting for your response....Cristian
//This is the OnPaint method
void CBadgeMakerDlg::OnPaint()
{
CPicture m_Picture;
BOOL checa=TRUE;
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
//this is the part modified by me
if (checa=TRUE){
/////show the picture
m_Picture.UpdateSizeOnDC(&dc); // Get Picture Dimentions In Pixels
m_Picture.Show(&dc, CPoint(0,0), CPoint(m_Picture.m_Width, m_Picture.m_Height), 0,0);
m_Picture.Show(&dc, CRect(0,0,100,100)); // Change Original Dimentions
}
else (checa=FALSE);
}
else
{
CDialog::OnPaint();
}
}
//and this is the funtion modified again
int CBadgeMakerDlg::OnBadge2()
{
CPicture m_Picture;
//CPaintDC dc(this);
BOOL checa = TRUE ;
HWND hwnd;
//////////load a picture from a file
checa= TRUE;
m_Picture.Load("c:\\FotosPrueba1\\image1.bmp"); // Load From a File - Just Load It (Show Later)
InvalidateRect(hwnd, NULL, TRUE);
return 0L;
}
NOTE.- When I compile the program only one error appears
|
|
|
|
|
this is not very complicated,
but U have to know how 2 do this:
both CPicture m_Picture; and BOOL checa;
should be defined in the header file of your main program
(.h)
it is called "member variable",
this member (m_Picture) is the same for all functions...
so if U update it on: OnBadge2()
it will still remain in OnPaint()
the OnPaint() is actually your paint event,
so U should use it to show things on the screen
(by calling Invalidate / InvalidateRect ...)
same goes for BOOL checa
and U should also initialize 'em both in the constructor
Best Regards - Yovav Gad
EMail: Dev@SuperMain.com
Web-Site: www.SuperMain.com
|
|
|
|
|
Hi!!!
I`m beginner in VC++, I`m need to know how can I display an image in a picture from a file, this is because I`m capturing an image from a webcam and it is stored as bmp format and displayed in a picture.
Now, I need to show the same image in other picture, because I will compare them...so, I need to have both images in the aplication.
I`m using the Picture library taht you published, but I don`t know if thus is the correct way...the code is below (OnBadge2 is the name of the picture of VC++).
NOTE: when I compile my program, any error appears, but the image doesn`t show in the picture...
thank you in advance faithfully Cristian!!!
void CBadgeMakerDlg::OnBadge2()
{
CPicture m_Picture;
CPaintDC dc(this);
//////////load a picture from a file
m_Picture.Load("c:\\FotosPrueba1\\image1.bmp"); // Load From a File - Just Load It (Show Later)
/////show the picture
m_Picture.UpdateSizeOnDC(&dc); // Get Picture Dimentions In Pixels
m_Picture.Show(&dc, CPoint(0,0), CPoint(m_Picture.m_Width, m_Picture.m_Height), 0,0);
m_Picture.Show(&dc, CRect(0,0,100,100)); // Change Original Dimentions
}
|
|
|
|
|
Your program is probably using the OnPaint() event,
so U better just Load() it on OnBadge2(),
but Show() it on OnPaint(),
1. put Load() in OnBadge2(),
2. put Invalidate() or InvalidateRect() in OnBadge2()
so it will call the paint event,
3. add a member "flag" (FALSE) variable and when OnBadge2()
is activated make it TRUE,
4. in the paint event check if your flag is TRUE,
if so - use Show() to show picture on the correct
paint event, and set the flag back to FALSE again...
good luck.
Best Regards - Yovav Gad
EMail: Dev@SuperMain.com
Web-Site: www.SuperMain.com
|
|
|
|
|
IPicture will change the width and the height of a picture loaded!
why?
who could tell me the way to operator the jpg file map?thanks !!
|
|
|
|
|
U can use the Show() function 2 show Regular size
or "Streached" size,
maybe your scolling area has changed,
if U want, send me your project zipped and specific info...
Best Regards - Yovav Gad
EMail: Dev@SuperMain.com
Web-Site: www.SuperMain.com
|
|
|
|
|
IPicture can't use in the map mode of MM_HIMETRIC ,MM_LOMETRIC .......
|
|
|
|
|
Hello,
Iam not sure if its related exactly to this tutorial...
I have a dialog based application with static control.
and a browse button. I want to load a bitmap from a .bmp file to the static control.
I have a DC to the control but I keep failing to load the bitmap how can I do it?
thanks
Yair
|
|
|
|
|
if U have DC 2 this control than it should work,
(maybe U need to Invalidate() your control)
or maybe U use the DC not correctly
(is it a pointer - &dc or an object - dc)
if U want, send me the source...
Best Regards - Yovav Gad
EMail: Development@SuperMain.com
Web-Site: www.SuperMain.com
|
|
|
|
|
thank you I sent you the code now...
thanks
Yair
|
|
|
|
|
Dear all,
First-chance exception in PictureShow.exe (GDI32.DLL): 0xC0000005: Access Violation.
First-chance exception in PictureShow.exe (GDI32.DLL): 0xC0000005: Access Violation.
|
|
|
|
|
I know there is a problem to pass compile on DEBUG mode
is this your problem ?
Try 2 replace this function in your CPictureShowDoc.cpp (CPictureShowDoc::CreateFilesList())
I think these two lines may fix it,
// 10X 2 Mr.Christian Wagner 4 His Help 2 Avoid An Assertion On Debug...
m_Finding = m_Finder.FindNextFile(); // Must Be Called Once Before IsDots()
Please let me know if it worked...
//-----------------------------------------------------------------------------
BOOL CPictureShowDoc::CreateFilesList()
//=============================================================================
{
m_Finding = m_Finder.FindFile("*.*"); // Finds All Files (By Name)
CString Extention;
m_FilesList.RemoveAll(); // Clear - In Case We Created Another List...
m_FilesList.GetHeadPosition();
while(m_Finding == TRUE)
{
// 10X 2 Mr.Christian Wagner 4 His Help 2 Avoid An Assertion On Debug...
m_Finding = m_Finder.FindNextFile(); // Must Be Called Once Before IsDots()
if(m_Finder.IsDots() || m_Finder.IsDirectory()) m_Finding = m_Finder.FindNextFile();
else // It Is a File...
{
// Get The Extention Of The Current Handled File
Extention.Format("%s", FileExtentionOnly(m_Finder.GetFileName()));
Extention.MakeUpper(); // Just In Case (Sensitive)...
// Add To The List
if(IsWantedExtention(Extention)) m_FilesList.AddTail(m_Finder.GetFileName());
m_Finding = m_Finder.FindNextFile();
}
}
// Handle The Last File...
Extention.Format("%s", FileExtentionOnly(m_Finder.GetFileName()));
Extention.MakeUpper(); // Just In Case (Sensitive)...
if(IsWantedExtention(Extention)) m_FilesList.AddTail(m_Finder.GetFileName());
m_Finder.Close();
// Get First Object On The List
// Do Not Use pApp->m_lpCmdLine Coz It Will Not Get Updated When OnFileOpen...
m_FilesListPosition = m_FilesList.GetHeadPosition();
m_FilesListPos = 1; // Coz We Are On The First Object On The List...
m_FilesListCount = m_FilesList.GetCount();
CString Clicked; // Make Sure We Count Spaces And UNICode...
Clicked.Format("%s", m_FilePathName);
// If File Was Clicked - Begin List Count From This File
if(Clicked.GetLength() > 0)
{
// Take Out Path Info...(Leave Only FileName)
Clicked.Format("%s", FileNameOnly(Clicked));
// Check If We Talking About a Wanted Extention
Extention.Format("%s", FileExtentionOnly(Clicked));
Extention.MakeUpper(); // Just In Case (Sensitive)...
// Check If It One Of These
if(IsWantedExtention(Extention))
{
for(int I=1; I < m_FilesListCount; I++) // Coz Starting From 1
{
Extention.Format("%s", m_FilesList.GetAt(m_FilesListPosition));
if(Clicked.CompareNoCase(Extention) == 0) break; // We Got It
m_FilesList.GetNext(m_FilesListPosition); // Move On The List
m_FilesListPos++;
}
}
}
/* DEBUG
CString S;
// Be Careful - Can READ List Objects If Not Exists
if(m_FilesListCount > 0)
{
S.Format("%d Picture Items On This Directory\t\nClicked = %d", m_FilesListCount, m_FilesListPos);
AfxMessageBox(S);
S.Format("First = \"%s\"", m_FilesList.GetAt(m_FilesListPosition));
AfxMessageBox(S);
}
if(m_FilesListCount > 1)
{
S.Format("Last = \"%s\"", m_FilesList.GetTail());
AfxMessageBox(S);
}
*/
return(TRUE);
}
Best Regards - Yovav Gad
EMail: Temp@Yovav.com
Web-Site: www.Yovav.com
|
|
|
|
|
I have had a compiling error:
PictureShow\PictureShow.rc(388) : fatal error RC4214: Codepage not valid
And I checked the code it is about the language used as shown below:
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_HEB)
#ifdef _WIN32
LANGUAGE 0xD, 0x1 // This line caused the trouble.
#pragma code_page(1255)
#endif //_WIN32
...
Maybe I have missed something. Can anyone help?
kes
|
|
|
|
|
1. what Windows do U use ?
2. try to delete all temporary files
plus the project .ncb file
and rebuild all...
Best Regards - Yovav Gad
EMail: Temp@Yovav.com
Web-Site: www.Yovav.com
|
|
|
|
|
I am using Win98 2nd Edition and SP3 for VC6.
I deleted the temporary files and that didn't work. I am still having the problem.
Any further suggestions.
Thanks.
|
|
|
|
|
Maybe U should try choose some other language,
there might be something special on your system
(people arround the world did have success compiling it)
Anyway:
0x0d LANG_HEBREW Hebrew
0x01 SUBLANG_DEFAULT User Default
LANGUAGE on MSDN:
Primary Language Identifiers:
Identifier Predefined symbol Language
0x00 LANG_NEUTRAL Neutral
0x01 LANG_ARABIC Arabic
0x02 LANG_BULGARIAN Bulgarian
0x03 LANG_CATALAN Catalan
0x04 LANG_CHINESE Chinese
0x05 LANG_CZECH Czech
0x06 LANG_DANISH Danish
0x07 LANG_GERMAN German
0x08 LANG_GREEK Greek
0x09 LANG_ENGLISH English
0x0a LANG_SPANISH Spanish
0x0b LANG_FINNISH Finnish
0x0c LANG_FRENCH French
0x0d LANG_HEBREW Hebrew
0x0e LANG_HUNGARIAN Hungarian
0x0f LANG_ICELANDIC Icelandic
0x10 LANG_ITALIAN Italian
0x11 LANG_JAPANESE Japanese
0x12 LANG_KOREAN Korean
0x13 LANG_DUTCH Dutch
0x14 LANG_NORWEGIAN Norwegian
0x15 LANG_POLISH Polish
0x16 LANG_PORTUGUESE Portuguese
0x18 LANG_ROMANIAN Romanian
0x19 LANG_RUSSIAN Russian
0x1a LANG_CROATIAN Croatian
0x1a LANG_SERBIAN Serbian
0x1b LANG_SLOVAK Slovak
0x1c LANG_ALBANIAN Albanian
0x1d LANG_SWEDISH Swedish
0x1e LANG_THAI Thai
0x1f LANG_TURKISH Turkish
0x20 LANG_URDU Urdu
0x21 LANG_INDONESIAN Indonesian
0x22 LANG_UKRAINIAN Ukrainian
0x23 LANG_BELARUSIAN Belarusian
0x24 LANG_SLOVENIAN Slovenian
0x25 LANG_ESTONIAN Estonian
0x26 LANG_LATVIAN Latvian
0x27 LANG_LITHUANIAN Lithuanian
0x29 LANG_FARSI Farsi
0x2a LANG_VIETNAMESE Vietnamese
0x2b LANG_ARMENIAN Armenian
0x2c LANG_AZERI Azeri
0x2d LANG_BASQUE Basque
0x2f LANG_MACEDONIAN FYRO Macedonian
0x36 LANG_AFRIKAANS Afrikaans
0x37 LANG_GEORGIAN Georgian
0x38 LANG_FAEROESE Faeroese
0x39 LANG_HINDI Hindi
0x3e LANG_MALAY Malay
0x3f LANG_KAZAK Kazak
0x40 LANG_KYRGYZ Kyrgyz
0x41 LANG_SWAHILI Swahili
0x43 LANG_UZBEK Uzbek
0x44 LANG_TATAR Tatar
0x45 LANG_BENGALI Not supported.
0x46 LANG_PUNJABI Punjabi
0x47 LANG_GUJARATI Gujarati
0x48 LANG_ORIYA Not supported.
0x49 LANG_TAMIL Tamil
0x4a LANG_TELUGU Telugu
0x4b LANG_KANNADA Kannada
0x4c LANG_MALAYALAM Not supported.
0x4d LANG_ASSAMESE Not supported.
0x4e LANG_MARATHI Marathi
0x4f LANG_SANSKRIT Sanskrit
0x50 LANG_MONGOLIAN Mongolian
0x56 LANG_GALICIAN Galician
0x57 LANG_KONKANI Konkani
0x58 LANG_MANIPURI Not supported.
0x59 LANG_SINDHI Not supported.
0x5a LANG_SYRIAC Syriac
0x60 LANG_KASHMIRI Not supported.
0x61 LANG_NEPALI Not supported.
0x65 LANG_DIVEHI Divehi
0x7f LANG_INVARIANT
SubLanguage Identifiers:
Identifier Predefined symbol Language
0x00 SUBLANG_NEUTRAL Language neutral
0x01 SUBLANG_DEFAULT User Default
0x02 SUBLANG_SYS_DEFAULT System Default
0x01 SUBLANG_ARABIC_SAUDI_ARABIA Arabic (Saudi Arabia)
0x02 SUBLANG_ARABIC_IRAQ Arabic (Iraq)
0x03 SUBLANG_ARABIC_EGYPT Arabic (Egypt)
0x04 SUBLANG_ARABIC_LIBYA Arabic (Libya)
0x05 SUBLANG_ARABIC_ALGERIA Arabic (Algeria)
0x06 SUBLANG_ARABIC_MOROCCO Arabic (Morocco)
0x07 SUBLANG_ARABIC_TUNISIA Arabic (Tunisia)
0x08 SUBLANG_ARABIC_OMAN Arabic (Oman)
0x09 SUBLANG_ARABIC_YEMEN Arabic (Yemen)
0x0a SUBLANG_ARABIC_SYRIA Arabic (Syria)
0x0b SUBLANG_ARABIC_JORDAN Arabic (Jordan)
0x0c SUBLANG_ARABIC_LEBANON Arabic (Lebanon)
0x0d SUBLANG_ARABIC_KUWAIT Arabic (Kuwait)
0x0e SUBLANG_ARABIC_UAE Arabic (U.A.E.)
0x0f SUBLANG_ARABIC_BAHRAIN Arabic (Bahrain)
0x10 SUBLANG_ARABIC_QATAR Arabic (Qatar)
0x01 SUBLANG_AZERI_LATIN Azeri (Latin)
0x02 SUBLANG_AZERI_CYRILLIC Azeri (Cyrillic)
0x01 SUBLANG_CHINESE_TRADITIONAL Chinese (Traditional)
0x02 SUBLANG_CHINESE_SIMPLIFIED Chinese (Simplified)
0x03 SUBLANG_CHINESE_HONGKONG Chinese (Hong Kong SAR, PRC)
0x04 SUBLANG_CHINESE_SINGAPORE Chinese (Singapore)
0x05 SUBLANG_CHINESE_MACAU Chinese (Macau SAR)
0x01 SUBLANG_DUTCH Dutch
0x02 SUBLANG_DUTCH_BELGIAN Dutch (Belgian)
0x01 SUBLANG_ENGLISH_US English (US)
0x02 SUBLANG_ENGLISH_UK English (UK)
0x03 SUBLANG_ENGLISH_AUS English (Australian)
0x04 SUBLANG_ENGLISH_CAN English (Canadian)
0x05 SUBLANG_ENGLISH_NZ English (New Zealand)
0x06 SUBLANG_ENGLISH_EIRE English (Ireland)
0x07 SUBLANG_ENGLISH_SOUTH_AFRICA English (South Africa)
0x08 SUBLANG_ENGLISH_JAMAICA English (Jamaica)
0x09 SUBLANG_ENGLISH_CARIBBEAN English (Caribbean)
0x0a SUBLANG_ENGLISH_BELIZE English (Belize)
0x0b SUBLANG_ENGLISH_TRINIDAD English (Trinidad)
0x0c SUBLANG_ENGLISH_ZIMBABWE English (Zimbabwe)
0x0d SUBLANG_ENGLISH_PHILIPPINES English (Philippines)
0x01 SUBLANG_FRENCH French
0x02 SUBLANG_FRENCH_BELGIAN French (Belgian)
0x03 SUBLANG_FRENCH_CANADIAN French (Canadian)
0x04 SUBLANG_FRENCH_SWISS French (Swiss)
0x05 SUBLANG_FRENCH_LUXEMBOURG French (Luxembourg)
0x06 SUBLANG_FRENCH_MONACO French (Monaco)
0x01 SUBLANG_GERMAN German
0x02 SUBLANG_GERMAN_SWISS German (Swiss)
0x03 SUBLANG_GERMAN_AUSTRIAN German (Austrian)
0x04 SUBLANG_GERMAN_LUXEMBOURG German (Luxembourg)
0x05 SUBLANG_GERMAN_LIECHTENSTEIN German (Liechtenstein)
0x01 SUBLANG_ITALIAN Italian
0x02 SUBLANG_ITALIAN_SWISS Italian (Swiss)
0x01 SUBLANG_KOREAN Korean
0x01 SUBLANG_LITHUANIAN Lithuanian
0x01 SUBLANG_MALAY_MALAYSIA Malay (Malaysia)
0x02 SUBLANG_MALAY_BRUNEI_DARUSSALAM Malay (Brunei Darassalam)
0x01 SUBLANG_NORWEGIAN_BOKMAL Norwegian (Bokmal)
0x02 SUBLANG_NORWEGIAN_NYNORSK Norwegian (Nynorsk)
0x01 SUBLANG_PORTUGUESE_BRAZILIAN Portuguese (Brazil)
0x02 SUBLANG_PORTUGUESE Portuguese (Portugal)
0x02 SUBLANG_SERBIAN_LATIN Serbian (Latin)
0x03 SUBLANG_SERBIAN_CYRILLIC Serbian (Cyrillic)
0x01 SUBLANG_SPANISH Spanish (Castilian)
0x02 SUBLANG_SPANISH_MEXICAN Spanish (Mexican)
0x03 SUBLANG_SPANISH_MODERN Spanish (Spain)
0x04 SUBLANG_SPANISH_GUATEMALA Spanish (Guatemala)
0x05 SUBLANG_SPANISH_COSTA_RICA Spanish (Costa Rica)
0x06 SUBLANG_SPANISH_PANAMA Spanish (Panama)
0x07 SUBLANG_SPANISH_DOMINICAN_REPUBLIC Spanish (Dominican Republic)
0x08 SUBLANG_SPANISH_VENEZUELA Spanish (Venezuela)
0x09 SUBLANG_SPANISH_COLOMBIA Spanish (Colombia)
0x0a SUBLANG_SPANISH_PERU Spanish (Peru)
0x0b SUBLANG_SPANISH_ARGENTINA Spanish (Argentina)
0x0c SUBLANG_SPANISH_ECUADOR Spanish (Ecuador)
0x0d SUBLANG_SPANISH_CHILE Spanish (Chile)
0x0e SUBLANG_SPANISH_URUGUAY Spanish (Uruguay)
0x0f SUBLANG_SPANISH_PARAGUAY Spanish (Paraguay)
0x10 SUBLANG_SPANISH_BOLIVIA Spanish (Bolivia)
0x11 SUBLANG_SPANISH_EL_SALVADOR Spanish (El Salvador)
0x12 SUBLANG_SPANISH_HONDURAS Spanish (Honduras)
0x13 SUBLANG_SPANISH_NICARAGUA Spanish (Nicaragua)
0x14 SUBLANG_SPANISH_PUERTO_RICO Spanish (Puerto Rico)
0x01 SUBLANG_SWEDISH Swedish
0x02 SUBLANG_SWEDISH_FINLAND Swedish (Finland)
0x01 SUBLANG_URDU_PAKISTAN Urdu (Pakistan)
0x02 SUBLANG_URDU_INDIA Urdu (India)
0x01 SUBLANG_UZBEK_LATIN Uzbek (Latin)
0x02 SUBLANG_UZBEK_CYRILLIC Uzbek (Cyrillic)
have fun.
Best Regards - Yovav Gad
EMail: Yovav@SuperMain.com
Web-Site: www.SuperMain.com
|
|
|
|
|
Dear,
I am sorry that I cannot use it successfully in my application program.
May I ask how to solve the problem?
My problem is like that.
" I have declared a MFC dialog. And then I have added a "picture" object (MFC)in the dialog which m_Screen is the CStatic object. After that, I have added following code to a function of dialog.
{
CPicture pdc;
CPaintDC dc(this);
CRect rc;
pdc.Load("c:\\test.jpg");
m_Screen.GetWindowRect(&rc);
CString demin;
demin.Format("left %d top %d right %d bottom %d",rc.left,rc.top,rc.right,rc.bottom);
AfxMessageBox(demin);
pdc.UpdateSizeOnDC(&dc); // Get Picture Dimentions In Pixels
//pdc.Show(&dc, CPoint(0,0), CPoint(m_Picture.m_Width, m_Picture.m_Height), 0,0);
HRESULT hr = pdc.Show(&dc, CRect(0,0,100,100));
}
The Show Method return true and success. But the picture cannot be shown.
Would you mind giving me a solution? Thank you very much.
best regards,
Ken
|
|
|
|
|
(I've been busy lately)
where do U do this ?
is it OnPaint() ?
(I Guess not)
if U did use the "dc" correctly
I think it might work if U use Invalidate()
or InvalidateRect()
if U want send me the source to Temp@Yovav.com
Best Regards - Yovav Gad
EMail: Temp@Yovav.com
Web-Site: www.Yovav.com
|
|
|
|
|
Hello,
i'm beginner and i test your class with dialog based application.
have you a response for this answer ?
|
|
|
|
|
You must use ClassWizard to add an OnPaint member function to the dialog; this function must convert the static control's ID to a CWnd pointer and get its device context. The trick is to draw inside the control window while preventing Windows from overwriting your work later. The Invalidate/UpdateWindow sequence achieves this. Here is an OnPaint function that show picture in a static control:
<br />
void CMyDialog::OnPaint()<br />
{<br />
CWnd* pWnd = GetDlgItem(IDC_STATIC1);
CDC* pControlDC = pWnd->GetDC();<br />
<br />
pWnd->Invalidate();<br />
pWnd->UpdateWindow();<br />
m_picture.UpdateSizeOnDC(pControlDC);<br />
m_picture.Show(pControlDC,CPoint(0,0), CPoint(m_picture.m_Width, m_picture.m_Height),0,0);<br />
pWnd->ReleaseDC(pControlDC);<br />
}<br />
As with all windows, the dialog's OnPaint function is called only if some part of the dialog is invalidated. You can force the OnPaint call from another dialog member function with the following statement:
<br />
Invalidate();<br />
If helpful for u ==> vote for me
|
|
|
|
|
Hi, great code!
Can anybode tell me how to rotate EMF picture (before or after I show it)?
|
|
|
|
|
Great sample, Thanks!
I have two questions:
1.From where we can find what are the un-used data from
IPicture::SaveAsFile()?
// Cut UnNeeded Data Coming From SaveAsFile() (Leave Only "Pure" Picture Data)
SkipFloat = (double(OutStream) / 512); // Must Be In a 512 Blocks...
if(SkipFloat > DWORD(SkipFloat)) ByteSkip = (DWORD)SkipFloat + 1;
else ByteSkip = (DWORD)SkipFloat;
ByteSkip = ByteSkip * 512; // Must Be In a 512 Blocks...
// Find Difference Between The Two Values
ByteSkip = (DWORD)(BytesStatistics.cbSize.QuadPart - ByteSkip);
// Allocate Only The "Pure" Picture Data
RealData.LowPart = 0;
RealData.HighPart = 0;
RealData.QuadPart = ByteSkip;
BufferBytes = (BYTE*)malloc(OutStream);
2.Is it possible to Render() to memery dc (not to screen), then get IBITMAP, from there we can get the bit map size and maybe GetDib... function could help to get the dib for making the bitmap file?
Best Regars,
|
|
|
|
|