|
Is there any API to get dimensions(height and width)of an image(jpg or gif)?
Please help..
|
|
|
|
|
|
With GDI+ it could be like this:
#include <windows.h>
#include <gdiplus.h>
#include <stdio.h>
using namespace Gdiplus;
INT main()
{
GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
Image* image = new Image(L"Crayons.jpg");
UINT imageHeight = image->GetHeight();
printf("The height of the image is %u.\n", imageHeight);
delete image;
GdiplusShutdown(gdiplusToken);
return 0;
}
viliam
|
|
|
|
|
Hi,
Well, I have a console based application which keeps printing to the console for every second or so. The problem that I am facing is when some user clicks on the console, the application is just hanging because of the "printf()" function. The thread resumes operation only after the user presses the right click button.
Any clues as to how I can over ride the mouse events in a console application? (this seems to be the only solution to me, any other solutions are more than welcome).
I have heard something about "GetConsoleWindow()" etc. which provides an alternative to printf()...any1 can please update me on this??
Thanks a lot folks.
Regards,
Mahadevan.
|
|
|
|
|
Hi!
I am writing an application kinda photo album in which i want to provide the page flip effect. i don't know what
should i select from the following:
DirectX
GDI
OpenGL
or something else.
currently i worked with my graphics+web designer and developed the application using Flash; but you might know that
flash is not reliable and doesn't provide better integration with VC.
I can code in VC, C# and VB/VB.NET. so i would appreciate your effort if you suggest me in this regard.
Thanks.
Muneeb-ur-Rehman Baig.
A thing of beauty is the joy forever.
|
|
|
|
|
|
GDI is most apropriate for this. Although you can use DirectX and OpenGL even if you are going to be using C#.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Hi!
I have source codes of my programs. One of them is dialog based application and the other is SDI Single Document Interface. I would like to combine that two sources into one. SDI program should have the dialog based program inside. What should I do?
Best regards.
|
|
|
|
|
CSdiApp
CSdiDoc
CSdiView
CSdiMainFrame
----------------
CDialogApp
CDialogDlg
---------------
now copy the clas CDialogDlg to the SDI app, you must also open
the .rc file from the dialog app and add the dialogtemplate to your SDI app
CSdiApp
CSdiDoc
CSdiView
CSdiMainFrame
CDialogDlg
now you must check the CDialogApp class, if there is some code you must
also add to your new App.
Add a menuentrie to the Mainmenu, and in the eventhandler for
this menu you can create a modal dialog of your
old app and show it to the user...
I hope this helps.
|
|
|
|
|
Hi
Thanks for help. But I got two questions:
wb wrote:
now copy the clas CDialogDlg to the SDI app, you must also open
the .rc file from the dialog app and add the dialogtemplate to your SDI app
1.I don’t know how to copy the calss CDialogDlg to the SDI app. I tried using Insert->New Class but I get that message:
CDialogDlg.cpp is not a member of the current project.
2. I don’t know how to add the dialogtemplate do my SDI app.
Any suggestions?
|
|
|
|
|
I have a MFC dialog based application that uses another dll that is MFC based generated using appwizard.
The problem is that when i try to run application the debug assertion fails in appcore.cpp in function
CWinApp::CWinApp(LPCTSTR lpszAppName) on following line :
ASSERT(AfxGetThread() == NULL);
Any help how this can be fixed and why i am encoutering the issue.
|
|
|
|
|
Can you help me to write the function which will describe the x,y 2-d coord
on the rotated sphere with v initial velocity. It can be top point of the sphere or for example number on the pool ball.
Thanks.
|
|
|
|
|
See here
Shog9
I'm not the Jack of Diamonds... I'm not the six of spades.
I don't know what you thought; I'm not your astronaut...
|
|
|
|
|
I need to parse xml files in an C++ SDI application. But to me as a beginner it seem's quite difficult how to use MSXML parser. Can anyone give me some hints?
|
|
|
|
|
Can't help with MSXML but I think you'll find articles here on CP if you do a search. Another option is to use pugXml, also here on CP which you may find easier.
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
Hi,
I'm having a problem or let's say that I don't know how to insert an image in a clasic CTreeCtrl. I found some samples but it doesen't work.
Plaese help!!
|
|
|
|
|
You can do it like this,
of course you can Add some extra images into a imagelist
I hope this frgment will be clear
CImageList m_imageList;
CTreeCtrl m_myTree;
......
m_imageList.Create( ........ );
m_myTree.SetImageList(&m_imageList, TVSIL_NORMAL);
m_myTree.SetItemImage( .., 0, 1);
viliam
|
|
|
|
|
Hi,
how can I programmaticly create and delete a folder???
|
|
|
|
|
raul.simcic wrote:
how can I programmaticly create and delete a folder???
CreateDirectory()
RemoveDirectory()
suhredayan There is no spoon.
|
|
|
|
|
This code is working for...
Open and Read the file "login.rec" in "RECENT" folder and add "USER_NICK" info for a combobox and enumerate "USER_NICK" for same combobox from all existing "USER_NICK.use" file.
this may have a assertion failure error
please fix this code for good working and no error.
BOOL CLogin::OnInitDialog()
{
CDialog::OnInitDialog();
CMainFrame *pMainWnd=(CMainFrame*)AfxGetMainWnd();
CDiet_caloView *pView=(CDiet_caloView*)pMainWnd->GetActiveView();
CString one1;
CString one;
CString RecentUser;
one1.Format("%s\\RECENT",pView->m_strInstallPath);
CFileStatus status;
if( CFile::GetStatus( one1, status ))
{
}
else
{
CreateDirectory(one1, NULL);
}
one.Format("%s\\RECENT\\login.rec",pView->m_strInstallPath);
if( CFile::GetStatus( one, status ))
{
CFile file;
file.Open(one,CFile::modeRead);
char ch[300];
int FileLength=file.GetLength();
file.Read(ch, FileLength);
char seps[]="#";
char *token;
token=strtok(ch,seps);
token=strtok(NULL,seps);
RecentUser.Format("%s",token);
file.Close();
}
CString sPath2;
sPath2.Format("%s",pView->m_strInstallPath);
WIN32_FIND_DATA stFindData;
HANDLE hFindFile;
CString sFile,sTextFile;
CString UserNick;
BOOL nRet;
int nCount;
int num;
char* sPtr=NULL;
sTextFile = sPath2;
sPath2 += "\\user\\*.use";
CString DD;
hFindFile = FindFirstFile(sPath2,&stFindData);
int doit=0;
((CComboBox *)GetDlgItem(IDC_COMBO1))->ResetContent();
while(hFindFile != INVALID_HANDLE_VALUE)
{
if(stFindData.dwFileAttributes != FILE_ATTRIBUTE_DIRECTORY)
{
sFile = stFindData.cFileName;
num=sFile.Find(".");
UserNick.Format("%s",sFile.Left(num));
((CComboBox*)GetDlgItem(IDC_COMBO1))->InsertString(doit,UserNick);
nCount = ((CComboBox *)GetDlgItem(IDC_COMBO1))->GetCount();
if(UserNick==RecentUser)
((CComboBox *)GetDlgItem(IDC_COMBO1))->SetCurSel(doit);
doit++;
}
nRet = FindNextFile(hFindFile,&stFindData);
if( !nRet ) break;
}
FindClose(hFindFile);
UpdateData(FALSE);
return TRUE; //return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
Image will remind us some feelings and if I can ask someone about a problem, that's not a bad life.
|
|
|
|
|
You failed to mention what part of the code was in error? It's doubtful you will get much help, if at all, by posting a bunch of code, most of which is irrelevant, and asking folks to look at it and find the problem. You need to have gone through it and narrowed the problem down to just a few lines of code and ask for help with those.
If you are going to use MFC, there is no need to use char , FindFirstFile() , strtok() , etc. That's not to say it won't work, but it makes no sense to bounce back and forth between the two unless you need something that MFC does/can not provide.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Please let me know from initial stage onwards
to learn the VC++ and need to master it.
I know very well C,C++,is it helpfull in developing in VC++
Please let me know regarding this asap,I greatly appriciate your response .
Thanks
Munisamy
|
|
|
|
|
Munisamy wrote:
is it helpfull in developing in VC++
Very helpfull.
Learn about MFC, search for MFC. Good luck.
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
DEPENDS ON WHAT YOU PROGRAM FOR !!!!
hey, you know what ? i love C++, but no language is THE language...
i'm sure one day i'll learn the klsdfhlskdh+++ !!! and perhaps you won't like it... :->
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
i'm sure one day i'll learn the klsdfhlskdh+++
HOpe so i think me also want to learn that tooo
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|