Saving image in picturebox to a jpeg file. Need help!!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need a way to take a graphic in a picture box and be able to save that
graphic as a jpeg file. I can save it as a bitmap file but I need to save it
as a jpeg file. Does anyone have a solution in Vb.Net or C#.Net for the
compact framework? I have seen a solution written in embedded c that will
convert a bitmap to a jpg but I just CANNOT get it to work for me.

Help!! Please!!

Thanks in advance and God Bless!
nb
 
Hi Sergey,
thank you 4 your support. However, I'm not able to manage your sample to
work, as it throws "MissingMethodException" both on the emulator and the
real PocketPc device. I've double-checked the presence of
ARM_JpegLibThunk.dll in the directory where resides the app, and it's there.
Any clue?
Again, lot of thanks in advance.

Sergey Bogdanov said:
Have you see this [1] example? It demonstrates how to save image as JPEG
file from HBITMAP or from byte array.

[1] http://www.sergeybogdanov.com/Samples/JpegTest.zip

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com


Noble said:
I need a way to take a graphic in a picture box and be able to save that
graphic as a jpeg file. I can save it as a bitmap file but I need to save
it as a jpeg file. Does anyone have a solution in Vb.Net or C#.Net for
the compact framework? I have seen a solution written in embedded c that
will convert a bitmap to a jpg but I just CANNOT get it to work for me.

Help!! Please!!

Thanks in advance and God Bless!
nb
 
Hi Sergey,
thanks 4 your help. However, I've tried your sample and it throws an
exception "MissingMethodException" when it calls ARM_WriteBitmapIntoJpegFile
Sergey Bogdanov said:
Have you see this [1] example? It demonstrates how to save image as JPEG
file from HBITMAP or from byte array.

[1] http://www.sergeybogdanov.com/Samples/JpegTest.zip

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com


Noble said:
I need a way to take a graphic in a picture box and be able to save that
graphic as a jpeg file. I can save it as a bitmap file but I need to save
it as a jpeg file. Does anyone have a solution in Vb.Net or C#.Net for
the compact framework? I have seen a solution written in embedded c that
will convert a bitmap to a jpg but I just CANNOT get it to work for me.

Help!! Please!!

Thanks in advance and God Bless!
nb
 
Are you trying to run it in WindowsCE or PPC? It is possible that
MissingMethodException was called for SHLoadImageFile, not for
WriteBitmapIntoJpegFile.

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com


Saverio said:
Hi Sergey,
thanks 4 your help. However, I've tried your sample and it throws an
exception "MissingMethodException" when it calls ARM_WriteBitmapIntoJpegFile
Have you see this [1] example? It demonstrates how to save image as JPEG
file from HBITMAP or from byte array.

[1] http://www.sergeybogdanov.com/Samples/JpegTest.zip

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com


Noble said:
I need a way to take a graphic in a picture box and be able to save that
graphic as a jpeg file. I can save it as a bitmap file but I need to save
it as a jpeg file. Does anyone have a solution in Vb.Net or C#.Net for
the compact framework? I have seen a solution written in embedded c that
will convert a bitmap to a jpg but I just CANNOT get it to work for me.

Help!! Please!!

Thanks in advance and God Bless!
nb
 
Hi Sergey;
actually, I've tried both on CE emulator and PPC emulator, and on PPC2002
device.
I've performed a traced execution and on CE em it stops on SHLoadImageFile,
while on PPC stops on xxx_Write.... Another little issue I've solved by
commenting out 3 lines is that on PPC it doesn't recognize the emulation, so
jumping all times to ARM.... But this is a not annoying issue. Of course,
I've double-checked the presence of dll and test.bmp files in every
environment. Thank in advance 4 your help, have a nice day!.

Sergey Bogdanov said:
Are you trying to run it in WindowsCE or PPC? It is possible that
MissingMethodException was called for SHLoadImageFile, not for
WriteBitmapIntoJpegFile.

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com


Saverio said:
Hi Sergey,
thanks 4 your help. However, I've tried your sample and it throws an
exception "MissingMethodException" when it calls
ARM_WriteBitmapIntoJpegFile
Have you see this [1] example? It demonstrates how to save image as JPEG
file from HBITMAP or from byte array.

[1] http://www.sergeybogdanov.com/Samples/JpegTest.zip

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com


Noble Bell wrote:

I need a way to take a graphic in a picture box and be able to save that
graphic as a jpeg file. I can save it as a bitmap file but I need to
save it as a jpeg file. Does anyone have a solution in Vb.Net or C#.Net
for the compact framework? I have seen a solution written in embedded c
that will convert a bitmap to a jpg but I just CANNOT get it to work for
me.

Help!! Please!!

Thanks in advance and God Bless!
nb
 
Hi, anothther little info:
I'm using 4 development VS .NET 2003, CF 1.0 SP2 (SP3 not yet installed as
I've seen bug fixed don't touch me), Actual device Cassiopeia EM300 PPC2002.
Looking forward to see from you.

Saverio Tedeschi said:
Hi Sergey;
actually, I've tried both on CE emulator and PPC emulator, and on PPC2002
device.
I've performed a traced execution and on CE em it stops on
SHLoadImageFile, while on PPC stops on xxx_Write.... Another little issue
I've solved by commenting out 3 lines is that on PPC it doesn't recognize
the emulation, so jumping all times to ARM.... But this is a not annoying
issue. Of course, I've double-checked the presence of dll and test.bmp
files in every environment. Thank in advance 4 your help, have a nice
day!.

Sergey Bogdanov said:
Are you trying to run it in WindowsCE or PPC? It is possible that
MissingMethodException was called for SHLoadImageFile, not for
WriteBitmapIntoJpegFile.

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com


Saverio said:
Hi Sergey,
thanks 4 your help. However, I've tried your sample and it throws an
exception "MissingMethodException" when it calls
ARM_WriteBitmapIntoJpegFile
"Sergey Bogdanov" <[email protected]> ha scritto nel messaggio

Have you see this [1] example? It demonstrates how to save image as JPEG
file from HBITMAP or from byte array.

[1] http://www.sergeybogdanov.com/Samples/JpegTest.zip

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com


Noble Bell wrote:

I need a way to take a graphic in a picture box and be able to save
that graphic as a jpeg file. I can save it as a bitmap file but I need
to save it as a jpeg file. Does anyone have a solution in Vb.Net or
C#.Net for the compact framework? I have seen a solution written in
embedded c that will convert a bitmap to a jpg but I just CANNOT get it
to work for me.

Help!! Please!!

Thanks in advance and God Bless!
nb
 
The problem is in PPC version. These DLLs were built for 4.x version
thus it works normally for PPC2003. You have to compile these libraries
from Src directory in eVC 3.0 and replace existent version with new
version of DLLs.

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com


Saverio said:
Hi, anothther little info:
I'm using 4 development VS .NET 2003, CF 1.0 SP2 (SP3 not yet installed as
I've seen bug fixed don't touch me), Actual device Cassiopeia EM300 PPC2002.
Looking forward to see from you.

Hi Sergey;
actually, I've tried both on CE emulator and PPC emulator, and on PPC2002
device.
I've performed a traced execution and on CE em it stops on
SHLoadImageFile, while on PPC stops on xxx_Write.... Another little issue
I've solved by commenting out 3 lines is that on PPC it doesn't recognize
the emulation, so jumping all times to ARM.... But this is a not annoying
issue. Of course, I've double-checked the presence of dll and test.bmp
files in every environment. Thank in advance 4 your help, have a nice
day!.

Are you trying to run it in WindowsCE or PPC? It is possible that
MissingMethodException was called for SHLoadImageFile, not for
WriteBitmapIntoJpegFile.

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com


Saverio Tedeschi wrote:

Hi Sergey,
thanks 4 your help. However, I've tried your sample and it throws an
exception "MissingMethodException" when it calls
ARM_WriteBitmapIntoJpegFile
"Sergey Bogdanov" <[email protected]> ha scritto nel messaggio


Have you see this [1] example? It demonstrates how to save image as JPEG
file from HBITMAP or from byte array.

[1] http://www.sergeybogdanov.com/Samples/JpegTest.zip

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com


Noble Bell wrote:


I need a way to take a graphic in a picture box and be able to save
that graphic as a jpeg file. I can save it as a bitmap file but I need
to save it as a jpeg file. Does anyone have a solution in Vb.Net or
C#.Net for the compact framework? I have seen a solution written in
embedded c that will convert a bitmap to a jpg but I just CANNOT get it
to work for me.

Help!! Please!!

Thanks in advance and God Bless!
nb
 
Thank you Sergey again.
I'm still in a little trouble since I was not able to find source files in
src directory of eVC 3.0, nor any function pointing to a "WriteBitmap..."
EntryPoint. Of course I can have overlooked something, as no one can call me
an eVC guru, I guess. Can you pls point me to the right direction, os send
src files, even to NG. LOT in advance, have a VERY nice day!

Sergey Bogdanov said:
The problem is in PPC version. These DLLs were built for 4.x version thus
it works normally for PPC2003. You have to compile these libraries from
Src directory in eVC 3.0 and replace existent version with new version of
DLLs.

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com


Saverio said:
Hi, anothther little info:
I'm using 4 development VS .NET 2003, CF 1.0 SP2 (SP3 not yet installed
as I've seen bug fixed don't touch me), Actual device Cassiopeia EM300
PPC2002. Looking forward to see from you.

Hi Sergey;
actually, I've tried both on CE emulator and PPC emulator, and on PPC2002
device.
I've performed a traced execution and on CE em it stops on
SHLoadImageFile, while on PPC stops on xxx_Write.... Another little issue
I've solved by commenting out 3 lines is that on PPC it doesn't recognize
the emulation, so jumping all times to ARM.... But this is a not annoying
issue. Of course, I've double-checked the presence of dll and test.bmp
files in every environment. Thank in advance 4 your help, have a nice
day!.

"Sergey Bogdanov" <[email protected]> ha scritto nel messaggio

Are you trying to run it in WindowsCE or PPC? It is possible that
MissingMethodException was called for SHLoadImageFile, not for
WriteBitmapIntoJpegFile.

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com


Saverio Tedeschi wrote:

Hi Sergey,
thanks 4 your help. However, I've tried your sample and it throws an
exception "MissingMethodException" when it calls
ARM_WriteBitmapIntoJpegFile
"Sergey Bogdanov" <[email protected]> ha scritto nel messaggio


Have you see this [1] example? It demonstrates how to save image as
JPEG file from HBITMAP or from byte array.

[1] http://www.sergeybogdanov.com/Samples/JpegTest.zip

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com


Noble Bell wrote:


I need a way to take a graphic in a picture box and be able to save
that graphic as a jpeg file. I can save it as a bitmap file but I
need to save it as a jpeg file. Does anyone have a solution in Vb.Net
or C#.Net for the compact framework? I have seen a solution written
in embedded c that will convert a bitmap to a jpg but I just CANNOT
get it to work for me.

Help!! Please!!

Thanks in advance and God Bless!
nb
 
Well, have you looked into JpegTest.zip\Dlls\Src directory? Anyway, I
recompiled it for WCE3.0 (you can download it here [1]) and now it works
for PPC2002 either.

Thank you for feedback and have a VERY nice day!

[1] http://www.sergeybogdanov.com/Samples/JpegTest.zip

--
Sergey Bogdanov
http://www.sergeybogdanov.com


Saverio said:
Thank you Sergey again.
I'm still in a little trouble since I was not able to find source files in
src directory of eVC 3.0, nor any function pointing to a "WriteBitmap..."
EntryPoint. Of course I can have overlooked something, as no one can call me
an eVC guru, I guess. Can you pls point me to the right direction, os send
src files, even to NG. LOT in advance, have a VERY nice day!

The problem is in PPC version. These DLLs were built for 4.x version thus
it works normally for PPC2003. You have to compile these libraries from
Src directory in eVC 3.0 and replace existent version with new version of
DLLs.

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com


Saverio said:
Hi, anothther little info:
I'm using 4 development VS .NET 2003, CF 1.0 SP2 (SP3 not yet installed
as I've seen bug fixed don't touch me), Actual device Cassiopeia EM300
PPC2002. Looking forward to see from you.

"Saverio Tedeschi" <[email protected]> ha scritto nel messaggio


Hi Sergey;
actually, I've tried both on CE emulator and PPC emulator, and on PPC2002
device.
I've performed a traced execution and on CE em it stops on
SHLoadImageFile, while on PPC stops on xxx_Write.... Another little issue
I've solved by commenting out 3 lines is that on PPC it doesn't recognize
the emulation, so jumping all times to ARM.... But this is a not annoying
issue. Of course, I've double-checked the presence of dll and test.bmp
files in every environment. Thank in advance 4 your help, have a nice
day!.

"Sergey Bogdanov" <[email protected]> ha scritto nel messaggio


Are you trying to run it in WindowsCE or PPC? It is possible that
MissingMethodException was called for SHLoadImageFile, not for
WriteBitmapIntoJpegFile.

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com


Saverio Tedeschi wrote:


Hi Sergey,
thanks 4 your help. However, I've tried your sample and it throws an
exception "MissingMethodException" when it calls
ARM_WriteBitmapIntoJpegFile
"Sergey Bogdanov" <[email protected]> ha scritto nel messaggio



Have you see this [1] example? It demonstrates how to save image as
JPEG file from HBITMAP or from byte array.

[1] http://www.sergeybogdanov.com/Samples/JpegTest.zip

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com


Noble Bell wrote:



I need a way to take a graphic in a picture box and be able to save
that graphic as a jpeg file. I can save it as a bitmap file but I
need to save it as a jpeg file. Does anyone have a solution in Vb.Net
or C#.Net for the compact framework? I have seen a solution written
in embedded c that will convert a bitmap to a jpg but I just CANNOT
get it to work for me.

Help!! Please!!

Thanks in advance and God Bless!
nb
 
Lot of thanks, Sergey, God Bless you!

Sergey Bogdanov said:
Well, have you looked into JpegTest.zip\Dlls\Src directory? Anyway, I
recompiled it for WCE3.0 (you can download it here [1]) and now it works
for PPC2002 either.

Thank you for feedback and have a VERY nice day!

[1] http://www.sergeybogdanov.com/Samples/JpegTest.zip

--
Sergey Bogdanov
http://www.sergeybogdanov.com


Saverio said:
Thank you Sergey again.
I'm still in a little trouble since I was not able to find source files
in src directory of eVC 3.0, nor any function pointing to a
"WriteBitmap..." EntryPoint. Of course I can have overlooked something,
as no one can call me an eVC guru, I guess. Can you pls point me to the
right direction, os send src files, even to NG. LOT in advance, have a
VERY nice day!

The problem is in PPC version. These DLLs were built for 4.x version thus
it works normally for PPC2003. You have to compile these libraries from
Src directory in eVC 3.0 and replace existent version with new version of
DLLs.

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com


Saverio Tedeschi wrote:

Hi, anothther little info:
I'm using 4 development VS .NET 2003, CF 1.0 SP2 (SP3 not yet installed
as I've seen bug fixed don't touch me), Actual device Cassiopeia EM300
PPC2002. Looking forward to see from you.

"Saverio Tedeschi" <[email protected]> ha scritto nel messaggio


Hi Sergey;
actually, I've tried both on CE emulator and PPC emulator, and on
PPC2002 device.
I've performed a traced execution and on CE em it stops on
SHLoadImageFile, while on PPC stops on xxx_Write.... Another little
issue I've solved by commenting out 3 lines is that on PPC it doesn't
recognize the emulation, so jumping all times to ARM.... But this is a
not annoying issue. Of course, I've double-checked the presence of dll
and test.bmp files in every environment. Thank in advance 4 your help,
have a nice day!.

"Sergey Bogdanov" <[email protected]> ha scritto nel messaggio


Are you trying to run it in WindowsCE or PPC? It is possible that
MissingMethodException was called for SHLoadImageFile, not for
WriteBitmapIntoJpegFile.

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com


Saverio Tedeschi wrote:


Hi Sergey,
thanks 4 your help. However, I've tried your sample and it throws an
exception "MissingMethodException" when it calls
ARM_WriteBitmapIntoJpegFile
"Sergey Bogdanov" <[email protected]> ha scritto nel
messaggio


Have you see this [1] example? It demonstrates how to save image as
JPEG file from HBITMAP or from byte array.

[1] http://www.sergeybogdanov.com/Samples/JpegTest.zip

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com


Noble Bell wrote:



I need a way to take a graphic in a picture box and be able to save
that graphic as a jpeg file. I can save it as a bitmap file but I
need to save it as a jpeg file. Does anyone have a solution in
Vb.Net or C#.Net for the compact framework? I have seen a solution
written in embedded c that will convert a bitmap to a jpg but I
just CANNOT get it to work for me.

Help!! Please!!

Thanks in advance and God Bless!
nb
 
Hi Sergey;
forgive me if I'm bothering you with my inexpertise, but dlls in
JpegTest.zip have "modifyDate" 04/26/05 and "VersionNumber" 1.0.0.1, and the
behaviour is the same (maybe your page is cached somewhere, even I for sure
don't use proxies), throwing "MissingMethodException". Now, trying to
compile libraries from src you provide, building JpegLibThunk causes an
error to raise:
" /JpegLib/jmorecfg.h (161) error C2371 'INT32' redefinition: different
basic types
........\include\types.h(21): see declaration of INT32' " (maybe I'm pointing
to the wrong types.h ?) and this error prevents me to build correctly.
BTW, the IsEmulator function still returns always False on PocketPc (both
Emulator and actual device) causing the program to abend (I worked once for
IBM) even if correctly compiled for the right platform. SYS.

Sergey Bogdanov said:
Well, have you looked into JpegTest.zip\Dlls\Src directory? Anyway, I
recompiled it for WCE3.0 (you can download it here [1]) and now it works
for PPC2002 either.

Thank you for feedback and have a VERY nice day!

[1] http://www.sergeybogdanov.com/Samples/JpegTest.zip

--
Sergey Bogdanov
http://www.sergeybogdanov.com


Saverio said:
Thank you Sergey again.
I'm still in a little trouble since I was not able to find source files
in src directory of eVC 3.0, nor any function pointing to a
"WriteBitmap..." EntryPoint. Of course I can have overlooked something,
as no one can call me an eVC guru, I guess. Can you pls point me to the
right direction, os send src files, even to NG. LOT in advance, have a
VERY nice day!

The problem is in PPC version. These DLLs were built for 4.x version thus
it works normally for PPC2003. You have to compile these libraries from
Src directory in eVC 3.0 and replace existent version with new version of
DLLs.

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com


Saverio Tedeschi wrote:

Hi, anothther little info:
I'm using 4 development VS .NET 2003, CF 1.0 SP2 (SP3 not yet installed
as I've seen bug fixed don't touch me), Actual device Cassiopeia EM300
PPC2002. Looking forward to see from you.

"Saverio Tedeschi" <[email protected]> ha scritto nel messaggio


Hi Sergey;
actually, I've tried both on CE emulator and PPC emulator, and on
PPC2002 device.
I've performed a traced execution and on CE em it stops on
SHLoadImageFile, while on PPC stops on xxx_Write.... Another little
issue I've solved by commenting out 3 lines is that on PPC it doesn't
recognize the emulation, so jumping all times to ARM.... But this is a
not annoying issue. Of course, I've double-checked the presence of dll
and test.bmp files in every environment. Thank in advance 4 your help,
have a nice day!.

"Sergey Bogdanov" <[email protected]> ha scritto nel messaggio


Are you trying to run it in WindowsCE or PPC? It is possible that
MissingMethodException was called for SHLoadImageFile, not for
WriteBitmapIntoJpegFile.

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com


Saverio Tedeschi wrote:


Hi Sergey,
thanks 4 your help. However, I've tried your sample and it throws an
exception "MissingMethodException" when it calls
ARM_WriteBitmapIntoJpegFile
"Sergey Bogdanov" <[email protected]> ha scritto nel
messaggio


Have you see this [1] example? It demonstrates how to save image as
JPEG file from HBITMAP or from byte array.

[1] http://www.sergeybogdanov.com/Samples/JpegTest.zip

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com


Noble Bell wrote:



I need a way to take a graphic in a picture box and be able to save
that graphic as a jpeg file. I can save it as a bitmap file but I
need to save it as a jpeg file. Does anyone have a solution in
Vb.Net or C#.Net for the compact framework? I have seen a solution
written in embedded c that will convert a bitmap to a jpg but I
just CANNOT get it to work for me.

Help!! Please!!

Thanks in advance and God Bless!
nb
 
Hi Sergey, this is an OT, However, have you ever been in Italy, or better,
are you the winner of the "Agimus" musical competition, which was performed
in Rome, on the last December. I'm asking you 'cause I've here Mr.Basile,
president of Agimus, who has read this thread and asked me: "How do you know
Mr Bogdanov and when have you met him?".
S&B
 
Hi Sergey, this is not OT.
now I've managed to download the sample you've provided, and it works fine,
both on emulator and the actual device PPC2002. Lot of thanks. I needed this
'cause I've designed the app 4 Italian Fencing Federation and there is just
a little issue: sync time when I sync processed data (from referees' PDAs to
competition bureau PC) as signatures taken on PDAs are about 40KB each one,
and I need a background 4 visibility purposes, so I can't use 1bit BMP and
there's the need to use JPG to save space, and time, during transmission;
this is to reduce traffic as well, in the aim to make things difficult for
wardrivers, since this way taking million packets requires a long hearing.
Have a nice day.
 
Hi Sergey.
I've managed to have my files jpeged in my app. However, I experienced an
issue with WriteRGBBytesIntoJpegFile which works and terminates with no
error, but when I try to see the processed image, there's garbage; on the
other hand, WriteBitmapIntoJpegFile works w/no problem. Maybe
SignatureCapture doesn't have the correct sequence of RGB; but if it's so,
why the other method goes fine? Maybe I've set incorrectly width and height,
but they are that of the SignatureCapture, so I'm not able to guess other
else.
Another little thing: in your JpegTest the IDE loads correctly X86... in the
emulator and ARM... in the actual device, while once I've ported the same
(er, almost same, my app is written in VB .NET) routines into my projects,
dlls are never deployed, and I've to load them manually to manage it to
work. Can you point me to the right direction? Thank you a lot, and have a
nice day, and Sunday!
 
Back
Top