 |
|
|
 |
|
 |
Hi,
I just wonder whether I can use this to load JPEG image from stream? I'm stuck with imgdecmp 
Thanks!
|
| Sign In·View Thread·PermaLink | 1.50/5 (2 votes) |
|
|
|
 |
|
|
 |
|
 |
Hi,If I want show jpg image from jpeg stream(buffer) not file how can I draw the image thanks
|
| Sign In·View Thread·PermaLink | 1.33/5 (3 votes) |
|
|
|
 |
|
|
 |
|
 |
thanks tanzim, i tried your code to display png images on pocket pc 2003, and it works well . just when i thought i'll have to do it the hard way (dealing with it as a binary resource or something)
[Kang Jodhi] [Mobile Developer] [Indonesia]
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
EVC 4.0
Appwizard new dialog,
add handler for paint message
bingo
void CProfileDlg::OnPaint() { CPaintDC dc(this); // device context for painting CBitmap bitmap;
// Attach the bitmap object to the HBITMAP returned by SHLoadImageFile bitmap.Attach(SHLoadImageFile(_T("/My Documents/demo.jpg")));
BITMAP bmpInfo; bitmap.GetBitmap(&bmpInfo);
CDC bitmapDC; bitmapDC.CreateCompatibleDC(&dc); CBitmap* pOldBitmap = bitmapDC.SelectObject(&bitmap);
dc.BitBlt(0, 0, bmpInfo.bmWidth, bmpInfo.bmHeight, &bitmapDC, 0, 0, SRCCOPY);
bitmapDC.SelectObject(pOldBitmap); bitmap.DeleteObject();
// Do not call CDialog::OnPaint() for painting messages }
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
 |
Hello Tanzim.
I wan to use ur code to load an image on a dialog-based application and set it in a static field using setBitmap. This is my code:
BOOL CTestBitmapDlg::OnInitDialog() { CDialog::OnInitDialog(); SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon CenterWindow(GetDesktopWindow CBitmap bitmap;
bitmap.Attach(SHLoadImageFile(_T("/VIC.BMP")));
m_bmp.SetBitmap(bitmap); m_bitmap.SetBitmap(bitmap); return TRUE; }
I'm new to evc++ . I'm not sure this is correct o not. But the image doesn't appear. What can i do? Can u show me the way?
Thanks.
|
| Sign In·View Thread·PermaLink | 2.50/5 (4 votes) |
|
|
|
 |
|
 |
Hello Tanzim!!! I try to use your article... But I cann`t find this function. VC++ 3.0 said that "error C2065: 'SHLoadImageFile' : undeclared identifier". I try to find it in file "aygshell.h". But it does not get result... May be I do something wrong?
With Best Regards Alexander A. Lopatkin.
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
Hi,
The most probable reason is that you are using an SDK that does not contain that function.
I used PocketPC 2002 SDK. Btw, if you just want to load a bitmap, SHLoadDIBitmap will do. Its included in Shellapi.h and you'll need to link to Shmisc.lib.
Hope this helps. T
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
You need 2 headers not included with the release of EVC++ 3.0. They are : -imgdecmp.h -imgrendr.h
This can be found in the nice little package released by VOImage.
In EVC++ 4.0 Microcrap did not include the imgdecmp.dll in the standard release of CE.Net. Not sure if a compatible version was released or not for .Net
|
| Sign In·View Thread·PermaLink | 1.50/5 (2 votes) |
|
|
|
 |
|
 |
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/guide_ppc/htm/_mdref_shloadimagefile.asp
Also doc'd on many other sites.
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
It wasen't documented when I wrote the article!! And in MSDN, its documented for PPC 2003, NOT 2002
Requirements Pocket PC Platforms: Pocket PC 2003 and later OS Versions: Windows CE .NET 4.0 and later Header: Declared in aygshell.h Library: Use aygshell.lib
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
when I try the sample code there, I don't know why no image will display immediately, only a page for inputting text. Also , when click on the file "Failed to open document"will appear while that file exists. Thanks for any help again!!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I dont have the header file How to compile it...? or where we can find it...
from a learner... With luv, Ramees...
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi,
Specifying the platform would help very much 
As for me, I used PocketPC 2002, with eVC++.
Tanzim Husain
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
 | eVB  |  | Chetan Kapadia | 3:58 17 Jan '03 |
|
|
 |
|
 |
Hello Guys!
Since the SHLoadImageFile method is in imgdecmp.dll, and if it ships with ce 4.1, then you might wanna try this:
// in .H, assuming class foo class foo { .... private: typedef HBITMAP (WINAPI* lpfnSHLoadImageFile)(LPCTSTR pszFileName);
private: HMODULE m_hDll; }
// in .CPP // in ctor load the dll, assuming class foo foo::foo():m_hDll(NULL) { m_hDll = ::LoadLibrary(_T("imgdecmp.dll")); }
// in the method where you'd need to load an image, assuming method bar void foo::bar() { lpfnSHLoadImageFile pFn = NULL; pFn = (lpfnSHLoadImageFile)GetProcAddress(m_hDll, _T("SHLoadImageFile")); if (pFn) { // do your stuff here , for example HBITMAP hbitmap = pFn(_T("/My Documents/Baloon.gif")); } }
// And finally, don't forget to unload the dll, in the dtor foo::~foo() { if (m_hDll) ::FreeLibrary(m_hDll); m_hDll = NULL; }
TH
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I inserted the codes above into my EVC project,but failed to compile ! I develop with <i>Evc4.0</i> on platform <i>WinCE4.1</i> .
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I've not tested the code under eVC 4.0.
Make sure that is included in your project.
If you need further assisatnce, please contact me .
Thanks.
TH
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I have searched all the possible header file,but I couldn't find the declaration of the function SHLoadImageFile.I think that whether it has been removed from CE4.1 by MS. Can I test it using the header file of PPC2002 in my 4.1 project? Thx to tanzim
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
You can not use the header files from the Pocket PC 2002 SDK. The function SHLoadImageFile must also be exported by a dll module. There must be another function for loading images under Windows CE 4.0 (.NET).
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Windows CE OS does not supprot the SHLoadImageFile function, this was added by the the Pocket PC 2002 team. Smartphone 2002 also supports the SHLoadImageFile.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |