Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

loading image to BitmapEx from 'array as byte'

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-08-2010, 10:39 AM
Byak@'s Avatar
Basic4ppc Veteran
 
Join Date: Jul 2008
Posts: 416
Send a message via ICQ to Byak@
Awards Showcase
Beta Tester 
Total Awards: 1
Default loading image to BitmapEx from 'array as byte'

how can i do it without saving image to file? i'm recive this image with NetUDP as bytes and place to array.but i must load this to BitmapEx object
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;
Reply With Quote
  #2 (permalink)  
Old 03-08-2010, 11:33 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Depends upon what format the data is in. If it is a bmp or jpg file sent as a stream of bytes then it is easiest to re-save it to a file and load it from there. If it is raw pixel RGB data then you could reassemle it into pixels and write it to a BitmapEx of the correct size using SetLockedPixel.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #3 (permalink)  
Old 03-08-2010, 12:28 PM
Byak@'s Avatar
Basic4ppc Veteran
 
Join Date: Jul 2008
Posts: 416
Send a message via ICQ to Byak@
Awards Showcase
Beta Tester 
Total Awards: 1
Default

2Andrew
yes,it is a bitmap image (i'm get it from WebCam with your lib).
saving to file and then load-it is so slow,i'm need a fast method (i'm receive image every 300ms)
i'm found this method(draw from bytes) in Alpha.dll but this lib have a conflict with ImageLibEx (with name of object)
can you add new method to your lib?
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;
Reply With Quote
  #4 (permalink)  
Old 03-08-2010, 01:57 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by Byak@ View Post
yes,it is a bitmap image
That's obvious but you haven't said whether it is formatted or raw pixel data.

If you are on the desktop you could use GDI+Desktop instead of ImageLibEx. This does not have an Alpha object which I assume is what the conflict is.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #5 (permalink)  
Old 03-10-2010, 10:34 PM
Byak@'s Avatar
Basic4ppc Veteran
 
Join Date: Jul 2008
Posts: 416
Send a message via ICQ to Byak@
Awards Showcase
Beta Tester 
Total Awards: 1
Default

ooops))
i have a new problem)))))how can i convert image(bitmap from bitmapex object) to bites(for send) without writing to file(amd reading with bin object).this method is slow,i'm need a fast method!
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;
Reply With Quote
  #6 (permalink)  
Old 03-11-2010, 11:07 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

This looked like a useful thing to be able to do so I've added it to my http://www.basic4ppc.com/forum/addit...html#post32641
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #7 (permalink)  
Old 03-11-2010, 06:23 PM
Byak@'s Avatar
Basic4ppc Veteran
 
Join Date: Jul 2008
Posts: 416
Send a message via ICQ to Byak@
Awards Showcase
Beta Tester 
Total Awards: 1
Default

big thanks Andrew
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;
Reply With Quote
  #8 (permalink)  
Old 03-16-2010, 11:00 PM
Byak@'s Avatar
Basic4ppc Veteran
 
Join Date: Jul 2008
Posts: 416
Send a message via ICQ to Byak@
Awards Showcase
Beta Tester 
Total Awards: 1
Default

i'm try send photo with network dll but...
please correct me.in my sample received image is broken
Attached Images
File Type: jpg fire.JPG (3.9 KB, 5 views)
Attached Files
File Type: sbp NetDemo_bitmap.sbp (8.7 KB, 7 views)
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;
Reply With Quote
  #9 (permalink)  
Old 03-18-2010, 07:18 PM
Byak@'s Avatar
Basic4ppc Veteran
 
Join Date: Jul 2008
Posts: 416
Send a message via ICQ to Byak@
Awards Showcase
Beta Tester 
Total Awards: 1
Default

UP.
any ideas? it is for my diplom and it is very important
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;

Last edited by Byak@ : 03-18-2010 at 07:24 PM.
Reply With Quote
  #10 (permalink)  
Old 03-18-2010, 07:52 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

The problem is most probably the way you are receiving the data. Your code is expecting it to all arrive at once and it won't. TCP/IP is a stream protocol not a block protocol so not all the data is guaranteed to arrive at once. You are trying to receive 49Kbytes which will need at least 32 Ethernet packets. You need to buffer up the received data on successive reads until you have the correct number and only then try to convert the bitmap. The number you give to ReadBytes is the maximum number of bytes that it will read but if the stream is empty because not all the data has arrived it will return less. You can see the number of bytes actually read from the return value of ReadBytes, use this to determine where in the buffer to save the data from the next read.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
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 Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
bitMapEx error Saj Questions (Windows Mobile) 8 09-15-2009 05:10 PM
put byte value into a string cotralis Questions (Windows Mobile) 5 09-13-2008 04:30 AM
Newbie: Background image loading enonod Questions (Windows Mobile) 2 04-27-2008 04:58 PM
JPEG to byte array without writing to file brathbone Questions (Windows Mobile) 2 03-01-2008 06:59 AM
How to convert image to an array of bytes kolbe Questions (Windows Mobile) 2 02-08-2008 08:43 PM


All times are GMT. The time now is 04:48 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0