Load image from file

G

Guest

Hi, I need to load BMP, PNG, JPEG images from file but I don't want to use
Bitmap class. I would like to call some API function that return me an
HBITMAP variable.

I've tried with LoadImage but it seems that this function don't work in
WinCE with flag LR_LOADFROMFILE.

Then I've read something about ImageLoader.DLL
(http://msdn.microsoft.com/msdnmag/issues/04/12/NETCompactFramework/default.aspx) and I've tried to use

LoadBitmapFromFile but I get MissingMethodException.

Anyone can help me ?

Thank you in advance.

Keven Corazza
 
G

Guest

I've developed a small cad application and I would like to manage images.

Keven Corazza
 
G

Guest

Thank you Alex for your answer.

I've tried SHLoadImageFile and it works for JPG and GIF image but I don't
get a valid HBITMAP handle when I try to load PNG.

I need also to manage BMP and TIFF files. How can I do that ?

I've seen your function that convert HBITMAP to Bitmap but perhaps I need
the opposite. How can I convert a Bitmap to HBITMAP handle ?

Thank you again for your help.

Keven Corazza

Alex Yakhnin said:
You can use the SHLoadImageFile if you're running your code on PPC's:

[DllImport("aygshell.dll", EntryPoint="#75", SetLastError=true)]
public static extern IntPtr SHLoadImageFile(
string szFileName );

As for converting HBITMAP to the managed Bitmap take a look at my post:

http://blog.opennetcf.org/ayakhnin/PermaLink.aspx?guid=533715eb-898c-4f60-8560-e1ae9bed9cc3

--
Alex Yakhnin, .NET CF MVP
www.intelliprog.com | www.opennetcf.org


Keven Corazza said:
Hi, I need to load BMP, PNG, JPEG images from file but I don't want to use
Bitmap class. I would like to call some API function that return me an
HBITMAP variable.

I've tried with LoadImage but it seems that this function don't work in
WinCE with flag LR_LOADFROMFILE.

Then I've read something about ImageLoader.DLL
(http://msdn.microsoft.com/msdnmag/issues/04/12/NETCompactFramework/default.aspx) and I've tried to use

LoadBitmapFromFile but I get MissingMethodException.

Anyone can help me ?

Thank you in advance.

Keven Corazza
 
P

Paul G. Tobey [eMVP]

It sounds to me like you need to buy an image management library and use
that for loading and displaying your images. I'm a little confused by what
a CAD package has to do with things like JPG images, too...

Paul T.

Keven Corazza said:
Thank you Alex for your answer.

I've tried SHLoadImageFile and it works for JPG and GIF image but I don't
get a valid HBITMAP handle when I try to load PNG.

I need also to manage BMP and TIFF files. How can I do that ?

I've seen your function that convert HBITMAP to Bitmap but perhaps I need
the opposite. How can I convert a Bitmap to HBITMAP handle ?

Thank you again for your help.

Keven Corazza

Alex Yakhnin said:
You can use the SHLoadImageFile if you're running your code on PPC's:

[DllImport("aygshell.dll", EntryPoint="#75", SetLastError=true)]
public static extern IntPtr SHLoadImageFile(
string szFileName );

As for converting HBITMAP to the managed Bitmap take a look at my post:

http://blog.opennetcf.org/ayakhnin/PermaLink.aspx?guid=533715eb-898c-4f60-8560-e1ae9bed9cc3

--
Alex Yakhnin, .NET CF MVP
www.intelliprog.com | www.opennetcf.org


Keven Corazza said:
Hi, I need to load BMP, PNG, JPEG images from file but I don't want to
use
Bitmap class. I would like to call some API function that return me an
HBITMAP variable.

I've tried with LoadImage but it seems that this function don't work in
WinCE with flag LR_LOADFROMFILE.

Then I've read something about ImageLoader.DLL
(http://msdn.microsoft.com/msdnmag/issues/04/12/NETCompactFramework/default.aspx)
and I've tried to use

LoadBitmapFromFile but I get MissingMethodException.

Anyone can help me ?

Thank you in advance.

Keven Corazza
 
G

Guest

Could you suggest me some of this library ?

Thanks.

Keven Corazza


Paul G. Tobey said:
It sounds to me like you need to buy an image management library and use
that for loading and displaying your images. I'm a little confused by what
a CAD package has to do with things like JPG images, too...

Paul T.

Keven Corazza said:
Thank you Alex for your answer.

I've tried SHLoadImageFile and it works for JPG and GIF image but I don't
get a valid HBITMAP handle when I try to load PNG.

I need also to manage BMP and TIFF files. How can I do that ?

I've seen your function that convert HBITMAP to Bitmap but perhaps I need
the opposite. How can I convert a Bitmap to HBITMAP handle ?

Thank you again for your help.

Keven Corazza

Alex Yakhnin said:
You can use the SHLoadImageFile if you're running your code on PPC's:

[DllImport("aygshell.dll", EntryPoint="#75", SetLastError=true)]
public static extern IntPtr SHLoadImageFile(
string szFileName );

As for converting HBITMAP to the managed Bitmap take a look at my post:

http://blog.opennetcf.org/ayakhnin/PermaLink.aspx?guid=533715eb-898c-4f60-8560-e1ae9bed9cc3

--
Alex Yakhnin, .NET CF MVP
www.intelliprog.com | www.opennetcf.org


:

Hi, I need to load BMP, PNG, JPEG images from file but I don't want to
use
Bitmap class. I would like to call some API function that return me an
HBITMAP variable.

I've tried with LoadImage but it seems that this function don't work in
WinCE with flag LR_LOADFROMFILE.

Then I've read something about ImageLoader.DLL
(http://msdn.microsoft.com/msdnmag/issues/04/12/NETCompactFramework/default.aspx)
and I've tried to use

LoadBitmapFromFile but I get MissingMethodException.

Anyone can help me ?

Thank you in advance.

Keven Corazza
 
P

Paul G. Tobey [eMVP]

Well, two minutes with Google gives: LEAD Tools, which I've used on the
desktop before. Very complete, there, at least.

You might also check things like magazine awards pages. This one, for
example:

http://www.pocketpcmag.com/awards/category_2004.asp?catid=46

I'm sure that there are others...

Paul T.

Keven Corazza said:
Could you suggest me some of this library ?

Thanks.

Keven Corazza


Paul G. Tobey said:
It sounds to me like you need to buy an image management library and use
that for loading and displaying your images. I'm a little confused by
what
a CAD package has to do with things like JPG images, too...

Paul T.

Keven Corazza said:
Thank you Alex for your answer.

I've tried SHLoadImageFile and it works for JPG and GIF image but I
don't
get a valid HBITMAP handle when I try to load PNG.

I need also to manage BMP and TIFF files. How can I do that ?

I've seen your function that convert HBITMAP to Bitmap but perhaps I
need
the opposite. How can I convert a Bitmap to HBITMAP handle ?

Thank you again for your help.

Keven Corazza

:

You can use the SHLoadImageFile if you're running your code on PPC's:

[DllImport("aygshell.dll", EntryPoint="#75", SetLastError=true)]
public static extern IntPtr SHLoadImageFile(
string szFileName );

As for converting HBITMAP to the managed Bitmap take a look at my
post:

http://blog.opennetcf.org/ayakhnin/PermaLink.aspx?guid=533715eb-898c-4f60-8560-e1ae9bed9cc3

--
Alex Yakhnin, .NET CF MVP
www.intelliprog.com | www.opennetcf.org


:

Hi, I need to load BMP, PNG, JPEG images from file but I don't want
to
use
Bitmap class. I would like to call some API function that return me
an
HBITMAP variable.

I've tried with LoadImage but it seems that this function don't work
in
WinCE with flag LR_LOADFROMFILE.

Then I've read something about ImageLoader.DLL
(http://msdn.microsoft.com/msdnmag/issues/04/12/NETCompactFramework/default.aspx)
and I've tried to use

LoadBitmapFromFile but I get MissingMethodException.

Anyone can help me ?

Thank you in advance.

Keven Corazza
 
G

Guest

Have you seen the XrossOne Mobile GDI+?

http://www.xrossone.com/
--
Alex Yakhnin, .NET CF MVP
www.intelliprog.com | www.opennetcf.org


Keven Corazza said:
Thank you Alex for your answer.

I've tried SHLoadImageFile and it works for JPG and GIF image but I don't
get a valid HBITMAP handle when I try to load PNG.

I need also to manage BMP and TIFF files. How can I do that ?

I've seen your function that convert HBITMAP to Bitmap but perhaps I need
the opposite. How can I convert a Bitmap to HBITMAP handle ?

Thank you again for your help.

Keven Corazza

Alex Yakhnin said:
You can use the SHLoadImageFile if you're running your code on PPC's:

[DllImport("aygshell.dll", EntryPoint="#75", SetLastError=true)]
public static extern IntPtr SHLoadImageFile(
string szFileName );

As for converting HBITMAP to the managed Bitmap take a look at my post:

http://blog.opennetcf.org/ayakhnin/PermaLink.aspx?guid=533715eb-898c-4f60-8560-e1ae9bed9cc3

--
Alex Yakhnin, .NET CF MVP
www.intelliprog.com | www.opennetcf.org


Keven Corazza said:
Hi, I need to load BMP, PNG, JPEG images from file but I don't want to use
Bitmap class. I would like to call some API function that return me an
HBITMAP variable.

I've tried with LoadImage but it seems that this function don't work in
WinCE with flag LR_LOADFROMFILE.

Then I've read something about ImageLoader.DLL
(http://msdn.microsoft.com/msdnmag/issues/04/12/NETCompactFramework/default.aspx) and I've tried to use

LoadBitmapFromFile but I get MissingMethodException.

Anyone can help me ?

Thank you in advance.

Keven Corazza
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top