Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Code Samples & Tips > Additional Libraries
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Additional Libraries Users contributed libraries.
This sub-forum is only available to licensed users.


dzImage Library


Reply
 
LinkBack Thread Tools Display Modes
  #51 (permalink)  
Old 03-08-2008, 11:25 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,700
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

I get the same on my Axim X30. It seems that not all devices appear to support saving anything other than BMPs even though the MS documentation for the Compact Framework implies that they should. However SaveImageBMP should work.
Reply With Quote
  #52 (permalink)  
Old 03-08-2008, 03:19 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Switzerland
Posts: 677
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

Hi Andrew,
You are right, SaveImageBMP does work.
I have modified the test code for the three image formats.

Best regards
Klaus
Switzerland
Reply With Quote
  #53 (permalink)  
Old 03-09-2008, 12:42 AM
brathbone's Avatar
Junior Member
 
Join Date: Feb 2008
Location: Rutherfordton, North Carolina
Posts: 19
Send a message via MSN to brathbone
Default

Hi agraham,

Thank you very much for posting the BitmapStreamSaver! I'll just need to add a fallback to BMP for incompatible devices. For thos devices that are compatible, this will be a big performance boost.

It's almost for me.

I have successfully used the following code from the Desktop IDE v6.05, but I cannot compile. The compiler shows error CS1026: ) Expected on the following line:

bitmapstreamsaver.SaveImageToStream(mystream.New2( client2.GetStream,0), mybitmap.Value,"J")

I suspect it is because I am calling mystream.new2 (I tried New1 as well) in the SaveImageToStream call. I tried creating the stream and just handing it to the SaveImageToStream call, as below:

(This code compiles, but does not actually function. When I run the compiled executable, it complains that Stream2 was not assigned any value)

mystream.New2(client2.GetStream,0)
bitmapstreamsaver.SaveImageToStream(mystream, mybitmap.Value,"J")

Any ideas as to where my syntax has gone wrong? Here is a more complete example sequence:

dzImageclass.ScreenCapture
mybitmap.New3(dzImageclass.Image)
bitmapstreamsaver.SaveImageToStream(mystream.New2( client2.GetStream,0), mybitmap.Value,"J")

As a side note, the unoptimized compiler will compile this code, but the compiled app does not send image data on desktop and complains on the device about an optionally assembly that cannot be found.


Thanks very much for all the help so far. It is truly appreciated.
__________________
Brian Rathbone

Laptop: AMD Turion 64 Mobile 2ghz, 2GB RAM, Dual GeForce Go 7900 GTX 768MB SLI, Dual 200GB HDD at RAID0. XP Pro sp2

Device: Treo 750, WM6, 300mhz,128MB RAM, 2GB miniSD, 240x240 display
Reply With Quote
  #54 (permalink)  
Old 03-09-2008, 10:44 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,700
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

I don't know what sort of object "my stream is" but I think it is unnecessary, just pass the stream from your client to the function.
Code:
bitmapstreamsaver.SaveImageToStream(client2.GetStream,mybitmap.Value,"J")
"New" methods don't generally return anything so are not valid as parameters in calls to Subs.
Reply With Quote
  #55 (permalink)  
Old 03-09-2008, 10:57 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,700
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by brathbone View Post
complains on the device about an optionally assembly that cannot be found.
This an error, the missing assembly contains complete error messages, caused by another error that therefore cannot be displayed. The missing assembly is sometimes not installed to save space. See here error messages on device
Reply With Quote
  #56 (permalink)  
Old 03-16-2008, 05:54 AM
brathbone's Avatar
Junior Member
 
Join Date: Feb 2008
Location: Rutherfordton, North Carolina
Posts: 19
Send a message via MSN to brathbone
Talking

Huge thanks to agraham!



Sorry it took me so long to respond; my workload got the best of me.

I now have a (mostly) working remote control agent for PPC. It looks like the Treo 750 is one of those devices that doesn't natively support saving to JPEG. Fortunately I was able to fall back on BMP.

I sincerely appreciate the time and effort of everyone who responded to my questions.

Have a great weekend,
__________________
Brian Rathbone

Laptop: AMD Turion 64 Mobile 2ghz, 2GB RAM, Dual GeForce Go 7900 GTX 768MB SLI, Dual 200GB HDD at RAID0. XP Pro sp2

Device: Treo 750, WM6, 300mhz,128MB RAM, 2GB miniSD, 240x240 display
Reply With Quote
  #57 (permalink)  
Old 03-16-2008, 10:43 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,700
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by brathbone View Post
It looks like the Treo 750 is one of those devices that doesn't natively support saving to JPEG. Fortunately I was able to fall back on BMP.
I have since found an authoritative quote from Microsoft that only WM5.0 and later support saving other formats than BMP. The OS DLL in WM2003 can apparently do it but the OS code to exploit it was omitted for some reason.
Reply With Quote
  #58 (permalink)  
Old 04-14-2008, 11:41 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Switzerland
Posts: 677
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

In using sahoopes CapSure Screenshot program I noticed a strange behaviour with the saved bitmaps.
Saved with the SaveImageBMP routine of the dzImage library.

As shown in the picture below, the original file Wine1dz.bmp is displayed upside down with ACDSee thumbnails, but it's normal in the viewer.

The vaHelpMaker doesn't recognize this file.

I copied it into Paint, selected the whole image and saved it back under Wine1.bmp and this file is OK.

I compared both files with Total Commander, and
- the bitmap width F0 00 00 00 (240 pixels) is OK
- the height 40 01 00 00 (320 pixels) is OK in the Wine1.bmp file
- but in the Wine1dz.bmp file it looks strange C0 FE FF FF (complementary value) ?

Has anybody experienced the same problem, or is it also due to WM 2003 as for saving jpg and gif format which do not work either?

Included the zip file with the 2 bmp files.

Thanks in advance.
Attached Images
File Type: jpg FileComparisonACDSee.jpg (31.9 KB, 30 views)
File Type: jpg FileComparisonWinComm.jpg (57.6 KB, 16 views)
Attached Files
File Type: zip Bmp_Problem.zip (11.2 KB, 8 views)
__________________
Klaus
Switzerland
Reply With Quote
  #59 (permalink)  
Old 04-15-2008, 01:53 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,700
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by klaus View Post
or is it also due to WM 2003 as for saving jpg and gif format which do not work either?
Nothing to do with that, that was an omission. Bitmaps in files can be saved top down or bottom up, normally bottom up. Wikipedia - "Uncompressed Windows bitmaps can also be stored from the top row to the bottom, if the image height value is negative". It looks like for some reason the Compact Framework saves bmps top down - I have no idea why! Apps may or may not interpet this correctly if they don't expect negative values.
Reply With Quote
  #60 (permalink)  
Old 04-15-2008, 03:11 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Switzerland
Posts: 677
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

Hi agraham,
Thank you for the explanations, now I understand better what's behind.
I was not aware that bitmaps could also be saved top down with a negative height value.

Best regards
__________________
Klaus
Switzerland
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
PhoneticAlgorithms Library (ex-StringComparison Library) moster67 Additional Libraries 10 11-11-2008 08:46 PM
dzImage wolfgang Additional Libraries 7 10-29-2008 01:09 PM
Door library (Beta) - Special library Erel Official Updates 48 07-18-2008 03:33 PM
Merging Outlook library and Phone library Erel Official Updates 2 07-14-2008 04:38 PM


All times are GMT. The time now is 10:50 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0