|
No and the result is not attractive.
|
|
|
|
|
Maybe on a virtual machine, like MS's Virtual PC.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
|
Hello friends,
I want to convert *.pcx image into *.jpg.
I want to do this conversion using Win32 Application in VC6.0
I am able to segregate the *.pcx header format and store the raw data in BIMAPINFO
strcuture.
But I don't know the header format and raw data requirement of *.jpg format.
I want to convert ICON.pcx file into ICON.jpg file using Win32.
Please give me the suggestion or source code if possible.
Waiting for your positive reply.
|
|
|
|
|
CXImage article on the codeproject is helpful for you(about formats of graphics).
|
|
|
|
|
CXImage is developed in MFC application. I just want to save *.pcx file into *.jpg
extension file using Win32 not by MFC.
Please give me information about;
How to save one format file into another file format.
|
|
|
|
|
|
Here's a way using GDI+...
#include <gdiplus.h>
...
BITMAPINFO *pBitmapInfo = ...;
BYTE *pBitmapPixelBits = ...;
ULONG dwToken;
Gdiplus::GdiplusStartupInput input;
Gdiplus::GdiplusStartupOutput output;
Gdiplus::Status status = Gdiplus::GdiplusStartup(&dwToken, &input, &output);
if(status == Gdiplus::Ok)
{
Gdiplus::Bitmap bitmap(pBitmapInfo, pBitmapPixelBits);
CLSID clsid;
GetEncoderClsid(L"image/jpeg", &clsid);
bitmap.Save(L"c:\\my.jpg", &clsid);
Gdiplus::GdiplusShutdown(dwToken);
}
...
int GetEncoderClsid(const WCHAR* format, CLSID* pClsid)
{
UINT num = 0;
UINT size = 0;
ImageCodecInfo* pImageCodecInfo = NULL;
GetImageEncodersSize(&num, &size);
if(size == 0)
return -1;
pImageCodecInfo = (ImageCodecInfo*)(malloc(size));
if(pImageCodecInfo == NULL)
return -1;
GetImageEncoders(num, size, pImageCodecInfo);
for(UINT j = 0; j < num; ++j)
{
if( wcscmp(pImageCodecInfo[j].MimeType, format) == 0 )
{
*pClsid = pImageCodecInfo[j].Clsid;
free(pImageCodecInfo);
return j;
}
}
free(pImageCodecInfo);
return -1;
}
If you can use ATL, the CImage class would allow you to do the same in a few lines of code.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
i have a dialog box, if i click 1 button on that dialog box, i am displaying another dialog box. when i close that popup dialog box, the main dialog box is also getting closed.
how do i keep parent window displyed even after closing child window(popup dialog).
thanks in advance
|
|
|
|
|
How did you close chid dialog?
|
|
|
|
|
void CMessage1::OnClose()
{
CDialog::OnClose();
}
|
|
|
|
|
Hi,
OnClose is not a member of CDialog.
And how it will close the dialog?
Can you write a bit more about problem.
I mean along with code.
|
|
|
|
|
I have got a problem, it goes like this:
In the older version of some of our .lib file, some functions run fine, but in the newer version of the same .lib file, those are inaccessible, I face the error as ‘Unresolved external symbol’. I am compiling my program in Visual C++ using VS 2005. I opened that concerned .lib file, and found that the concerned functions are there in the file, but those are not accessible to my program. It doesn’t have its DLL. Could you give me its solution, or possible reasons why it’s happening? I will be grateful.
Thanks in advance.
Software Developer
Sanjay Khapre
|
|
|
|
|
Hi All,
I have a legacy project with makefile.
Is there any way that i can convert the project to visual studio 2005 solution ?
Thanks in advance...
Appu..
"Never explain yourself to anyone.
Because the person who likes you does n't need it.
And the person who dislikes you won't believe it."
|
|
|
|
|
how to use the code available in net in your project
e.g suppose i want to have style button in my gui...i down load the .h and .cpp from net..then add the files to my project ..but still there is some problem so that that style button was coming in my o/p..so can any body tell me the exact way so that i can use the code availble in net in my project..
thaking all of u..
|
|
|
|
|
You're still not quite getting it, are you?
What bloody code?
Your question sounds a little like this:
"I was driving down the road, and my car stopped. WHY?"
If you provide virtually no information, you're virtually guaranteed to get no answer.
Can somebody tell me where CodeProject claims to be a forum full of psychics or mind-readers?
|
|
|
|
|
More more explain is helpful!
|
|
|
|
|
see i am a beginner so if there is some problem with question then am sorry but i am also a new user too.so instade of critising me u should cope up..as all r not talented by birth.
|
|
|
|
|
You have cpp/h files and you imported these files to your project but it seems they dont work on your project.did you declare your variables of this class(I dont know its name) instead CButton class? (also more explain is helpful).
|
|
|
|
|
Hi,
I am facing problem in SHGetFileInfo API. Code is below:
CoInitialize(NULL);
SHFILEINFO fi;
BOOL bReturn = FALSE;
HIMAGELIST himl = NULL;
ZeroMemory (&fi, sizeof (fi));
himl = (HIMAGELIST)SHGetFileInfo (NULL, 0, &fi, sizeof (fi), SHGFI_ATTRIBUTES | SHGFI_SYSICONINDEX | SHGFI_SMALLICON);
In my project I am writing this code in OnInitDialog() but "himl" is coming NULL but if a write the same code in a fresh project I is retuning non zero.
What is the problem plz suggest me?
|
|
|
|
|
I got the problem, my project in set to Unicode.
But why this API is not working in Unicode defind project?
|
|
|
|
|
MPTP wrote: What is the problem plz suggest me?
Have you called CoInitialize() or OleInitialize() ?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I am trying to render multiple texts in different fonts and sizes using OpenGL.
but the use of wglusefontbitmaps seems to cause some memory leakage? How can I avoid this. I am attaching the code for rendering below
void M4DScreenData::RenderOverlayData( HWND hWnd_i )
{
GLint nDisplayList = glGenLists( 128 );
HDC hDC = ::GetDC( hWnd_i );
HFONT hOldFont;
HFONT hNewFont;
glClearColor( 0.0f, 0.0f, 0.0f, 1.0f );
// Clear the window with current clearing color
glClear(GL_COLOR_BUFFER_BIT);
TextData TextDataobj;
POSITION nPos = m_DataMap.GetStartPosition();
int nID = 0;
glColor3ub( 255, 255, 255 ); // Overlay data color
while( nPos )
{
if( 0 != m_Font.GetSafeHandle())
{
m_Font.DeleteObject();
}
m_DataMap.GetNextAssoc( nPos, nID, TextDataobj ); //Cmap that contains the data,font and size
CString csOverLayData = TextDataobj.GetText();
int nLength = csOverLayData.GetLength();
CPoint Location = TextDataobj.GetPos();
m_Font.CreatePointFont(( TextDataobj.GetFontSize()) * 10, TextDataobj.GetFontName(), NULL );
hNewFont = ( HFONT )m_Font.GetSafeHandle();
hOldFont = ( HFONT )SelectObject( hDC, hNewFont );
wglUseFontBitmaps( hDC, 0, 128, nDisplayList );
glListBase( nDisplayList );
// Position the text in the window, at location (Xcoord, Ycoord)
glRasterPos2d( Location.x, Location.y );
glCallLists( nLength, GL_SHORT, csOverLayData ); // Display overlay data
SelectObject( hDC, hOldFont );
}
if( 0 != nDisplayList )
{
glDeleteLists( nDisplayList, 128 );
}
}
|
|
|
|
|
I have happily and successfully programmed graphics processing for many years using VB, but I want to port the project over to VC++. As a trial a week ago I looked at C# and found no problems. However, C++ proved to be hell . I started with a form (Form1), dressed it up OK and loaded images, scroll bars worked. It all worked OK. I then added a second form (CAMERAFrm) and could not open it from the first one. I tried all sorts of variants of ShowDialog() found on MSDN, in forums and books, to no avail. The error messages summarised say that CAMERAFrm is unknown, even when I include each .h form in the code of the other and spell its name out fully. The project name is cppPOSTERclr and the two forms are said to be - public - and - ref class - but whether I try to use CAMERAFrm as a class-
CAMERAFrm ^ DSLR =gcnew CAMERAFrm
DSLR->ShowDialog(this)
or as an object-
CAMERAFrm->ShowDialog(this)
the project claims CAMERAFrm is undefined.
Intelisense and edit panel titles gives me cppPOSTER::Form1 and cppPOSTER::CAMERAFrm as valid names with global scope. However, even when I try to use cppPOSTER::CAMERAFrm I get messages such as-
error C2039 'CAMERAFrm': is not a member of 'cppPOSTERclr'
error C2039 'CAMERAFrm': is not a member of 'cppPOSTERclr::Form1'
I can open a third new window:-
Form ^ DSLR= gcnew Form()
DSLR->ShowDialog(this)
Can anyone tell me what is happening? I did nothing fancy: just opened two forms and tried to open the second from a button in the first.
Surely VC++ isn't a savant - good for intricate detail but hard to get on with in everday life!
|
|
|
|
|
u need to add the .h file for your CAMERAFrm in Form1.h file and then create a member of CAMERAfrm in Form1.h
Then on button click call DoModal()
This will work for you.
|
|
|
|