|
Hai!
Acutually i am developing an dialog based application in eVC++ 4.0 for a Pocket PC device. I actually have to display .jpg and .jp2(.jpg2000) images in my dialog. i was searching through net for simplest code but in vain.
Finally i copied some code that converts .jpg to .bmp, As i am able to display .bmp images i started using that code, but it uses CopyImage()
that is not supported in eVC++,
Can you suggest me
1. Simple code in eVC++ that displays .jp2 &.jpg images
or
2. How to easily convert .jp2 and .jpg images to .bmp
or
3. Function similiar to CopyImage() in eVC++;
I have posted the 1st doubt in Code project recently, i have even got good response
"http://msdn.microsoft.com/en-us/magazine/cc301454.aspx"
but i am uanble to use it??
Assuming that both .jpg and.jp2 file are present in :
C:\Documents and Settings\MyFolder
Now can you please code me how to display the images , I tried but not successful!
thanks!
|
|
|
|
|
kapardhi wrote: but i am uanble to use it??
Why?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: Why?
Bcoz i couldnot figure out what he was describing!
I think he was explaining two different logics.
Can u please explain in short using code snippets what he meant ?
Thanks!
|
|
|
|
|
He uses COM to load the image. You may use MFC CImage , instead (if available in embedded VC++). BTW: why don't you ask in the Mobile Development forum [^]?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
have a look at [SHLoadImageFile^], [SHLoadImageResource^] this is supported from Windows CE .NET 4.0 and later so you must be able to use in evc++, if you are planning to use higher version (WCE 5.0) try using Imaging API there is a sample in SDK path.
|
|
|
|
|
Hi everybody,
if I display the MainFrame (at the start) in fullscreen. The user cant access the taskbar, which is in autohide mode.
Normally if the user places the mouse at the bottom of the screen, the taskbar slides up and is available. In this case, the taskbar even dont appear.
If i restore the MainFrame to the Non-Fullscreen-Mode the taskbar is still not accessible.
Only if I switch to another application and re-switch on my application, then I can access the taskbar correctly.
Big thanks for any suggestions.
Greetings
|
|
|
|
|
hi,
i get the following errors when i run the NggolekiGinambaran program. i use
jbig.lib
j2000.lib
cximage.lib
demo.lib
Jpeg.lib
.............
Error 1 error LNK2019: unresolved external symbol "public: bool __thiscall CxImageRAW::Decode(class CxFile *)" (?Decode@CxImageRAW@@QAE_NPAVCxFile@@@Z) referenced in function "public: bool __thiscall CxImage::Decode(class CxFile *,unsigned long)" (?Decode@CxImage@@QAE_NPAVCxFile@@K@Z) c:\Documents and Settings\tasmin\Desktop\Ref Projects\CBIR\NggolekiGinambaran\cximage.lib 1 NggolekiGinambaran
Error 2 error LNK2019: unresolved external symbol "public: bool __thiscall CxImageMNG::Decode(class CxFile *)" (?Decode@CxImageMNG@@QAE_NPAVCxFile@@@Z) referenced in function "public: bool __thiscall CxImage::Decode(class CxFile *,unsigned long)" (?Decode@CxImage@@QAE_NPAVCxFile@@K@Z) c:\Documents and Settings\tasmin\Desktop\Ref Projects\CBIR\NggolekiGinambaran\cximage.lib 1 NggolekiGinambaran
i got the NggolekiGinambaran program from the following link ....
"http://www.codeproject.com/KB/graphics/cbir.aspx?display=PrintAll&fid=9137&df=90&mpp=25&noise=3&sort=Position&view=Quick&fr=26&select=1079489">Finding Similiar Images[
please help.....
tasmin
modified on Thursday, April 23, 2009 7:52 AM
|
|
|
|
|
tasmin iqbal wrote: NggolekiGinambaran
This sounds like something H. P. Lovecraft could have cooked up.
|
|
|
|
|
|
tasmin iqbal wrote: i use
jbig.lib
j2000.lib
cximage.lib
demo.lib
Jpeg.lib
Did you add those libraries (or at least the CXImage.lib) to your project settings ?
|
|
|
|
|
yes i did add them to my project
|
|
|
|
|
Help. Please. How can I solve DirectShow issues.
unresolved CLSID CLSID_CaptureGraphBuilder2. I can not find this in the registry either.
hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC,
IID_IGraphBuilder, (void **) & g_pGraph);
fails.
I am using Win XP, VS 2005
MS SDK February 2003 SDK Release
Microsoft DirectX SDK (August 2007)
Is there a version mismatch.
Samples do not compile either.
Thanks in advance.
|
|
|
|
|
ICaptureGraphBuilder2 is an interface not the object, shall be refered as IID_ICaptureGraphBuilder2 as in ,
CoCreateInstance( CLSID_CaptureGraphBuilder,
NULL,
CLSCTX_INPROC_SERVER,
IID_ICaptureGraphBuilder2,
(void**) &pCaptureGraphBuilder)
ICaptureGraphBuilder2 is exposed by CaptureGraphBuilder (There is no CLSID_CaptureGraphBuilder2)
|
|
|
|
|
Thanks for the reply. I guess I am too new to this. Still many samples from CP are not compiling. So it is not even my code.
Thanks,
|
|
|
|
|
I've got an assignment that I've been struggling with all day, and after re-doing the program several times I believe I've narrowed down my problem to this:
#include <stdio.h>
#include <stdlib.h>
int random;
int guess;
char play = 'y';
int game = 1;
int main()
{
while(game == 1)
{
if(play == 'y')
{
random = 1 + rand() % 1000;
printf("\nI have a number between 1 and 1000.\nCan you guess my number?\nType your first guess:");
play = 'v';
}
scanf("%i",&guess);
if(guess == random)
{
printf("\nExcellent! You guessed the number!\nWould you like to play again?(y/n)");
scanf("%c",&play);
if(play == 'n')
{
game = 0;
}
}
else
{
if(guess < random && guess != random)
{
printf("\nToo low, try again!");
}
if(guess > random && guess != random)
{
printf("\nToo high, try again!");
}
}
}
return 0;
}
</stdlib.h></stdio.h>
When I enter the if(guess == random){} block and answer the (y/n) question, the program falls apart. No matter what I seem to do, it'll shut down, stop functioning, or repeat that block once more before it moves on to what it's supposed to do. I don't understand what I'm doing wrong.
|
|
|
|
|
your program is too difficult to get the right number.
because every time after one loop your random have changed, who can guess a unmber just equal one random number form 1 to 1000.
|
|
|
|
|
StateofMind09 wrote: if(guess < random && guess != random)
{
printf("\nToo low, try again!");
}
if(guess > random && guess != random)
{
printf("\nToo high, try again!");
}
Funny.
Do you really think
if ( guess < random )
{
}
else
{
}
is not enough?
[added]
BTW: It shouldn't 'fall apart'. Why don't you use the debugger to see what actually happens?
[/added]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
modified on Thursday, April 23, 2009 4:11 AM
|
|
|
|
|
Your problem is that when you enter the correct guess, you type a return character after the number to terminate the line. The scanf("%c",&play); line will then read that character as your (first) response, rather than the 'y' or 'n'.
I would recommend altering that bit of the program into a loop, so it validates your input, so instead of this:
scanf("%c",&play);
if(play == 'n')
{
game = 0;
}
have this:
do
{
scanf("%c", &play);
} while (play != 'y' && play != 'n');
if(play == 'n')
{
game = 0;
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I want to play the .mov file in the directshow. I am able to play
the .mov file in the graphedit. But when I am using code for this then it is not add in the graphedit.
my code is
DEFINE_GUID(CLSID_QuickTimeDecoder,0x64c6bf57,0x2d38,0x4d10,0xa1,0xdf,0x33,0x0a,0xd9,0x8c,0xd4,0xc2);
// Create the filter graph manager and query for interfaces.
hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,IID_IGraphBuilder, (void **)&pGraph);
if (FAILED(hr))
{
printf("ERROR - Could not create the Filter Graph Manager.");
return;
}
hr = CoCreateInstance(CLSID_QuickTimeDecoder,NULL,CLSCTX_INPROC_SERVER,IID_IBaseFilter,(void **)&QuickTime);
if(FAILED(hr))
{
MessageBoxA(NULL,"failed to CLSID_QuickTimeDecoder","",NULL);
}
hr = pGraph->AddFilter(QuickTime,L"Quick Time Decoder");
if(FAILED(hr))
{
MessageBoxA(NULL,"failed Quick Time Decoder","",NULL);
}
hr = QuickTime->QueryInterface(IID_IFileSourceFilter,(void **)&pReader);
if(FAILED(hr))
{
ShowMessage(hr);
}
hr = pReader->Load(L"C:\\Documents and Settings\\Equinox\\Desktop\\movutvi\\dlf.mov",NULL);
if(FAILED(hr))
{
ShowError(hr);
ShowMessage(hr);
}
I am getting the problem at pReader->Load().where i am wrong
pls help me.
|
|
|
|
|
Hai!
In my dialog box i am able to display bitmap images by inserting an picture control in my dialog box and using the following code in Visual C++ :
HBITMAP hBitmap;
hBitmap = (HBITMAP) LoadImage (NULL, "C:\\Documents and Setttings\\MyPC\\Desktop\\MyImage.bmp", IMAGE_BITMAP, SM_CXICON, SM_CYICON, LR_LOADFROMFILE);
csMyImage.SetBitmap (hBitmap);
But how can i display .jp2 and .jpg images in my dialog box
Thanks!
|
|
|
|
|
|
Thankyou !
Assuming that both .jpg and.jp2 file are present in :
C:\Documents and Settings\MyFolder
Now can you please code me how to display the images , Itried but not successful!
Thanks!
|
|
|
|
|
You can use CImage class.
#include "atlimage.h"
CImage pImage;
HRESULT hResult = pImage.Load(m_TempPath);
if (FAILED(hResult)) {
.....
}
CSize m_ScrSize;
m_SrcSize.cx=m_ImageSize.cx=pImage.GetWidth();
m_SrcSize.cy=m_ImageSize.cy=pImage.GetHeight();
CClientDC *pDC;
pImage.StretchBlt(pDC->m_hDC,0,0,m_ImageSize.cx,m_ImageSize.cy,0,0,m_SrcSize.cx,m_SrcSize.cy,SRCCOPY);
pImage.Destroy();
|
|
|
|
|
I am getting the following error message
Run-Time Check Failure #3 - The variable 'pDC' is being used without being defined.
Thanks!
|
|
|
|
|
Hello All,
I am trying to convert a list of Strings in LPWSTR* array. I am using the following way to convert it. But here the problem occurs in the returning array items. It contains all the elements same in the array. I found the problme is due to memset() which updates the memory address everytime same as earlier. Please help me out----
for(DWORD i = 0; i < itemIds->Count; i++)
{
ATL::CComBSTR itemWChar;
itemWChar = ::GetAtlBstr(itemIds[i]);
WCHAR _itemWChar[_MAX_PATH];
memset(_itemWChar, 0, sizeof(_itemWChar) / sizeof(_itemWChar[0]));
memcpy(_itemWChar, static_cast<bstr>(itemWChar), itemWChar.ByteLength());
items[i] = _itemWChar;
}
ANURAG VISHNOI,
Sr. Software Engineer,
|
|
|
|
|