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.

Fill Image from response.GetStream

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-22-2007, 11:50 AM
Newbie
 
Join Date: Nov 2007
Posts: 2
Default Fill Image from response.GetStream

Is it possible to fill an image from response.GetStream without writing it out to a file first?

Thanks in advance
Chris
Reply With Quote
  #2 (permalink)  
Old 11-22-2007, 02:42 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,728
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

No. You will need to save it as a temporary file first.
Reply With Quote
  #3 (permalink)  
Old 11-22-2007, 03:14 PM
Newbie
 
Join Date: Nov 2007
Posts: 2
Default

Thanks.

So I tried writing it out. Unfortunately when I try to write out a new version of the image it does not allow me that as the file is locked. The lock is caused by Image1.Image = "MapImage.gif".

So the first time it works, the second time FileOpen fails because of the lock. I tried pointing Image1 to another image and FileCopy, but the lock remains.

Any thoughts?
Chris
Reply With Quote
  #4 (permalink)  
Old 11-22-2007, 04:07 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,728
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

I've attached an example which uses a Bitmap object (from the ImageLib library) to load an image from a temporary file, assign it to an Image control and delete the file.
Two 'tricks' are used:
By calling Image1.Image = Image1.Image we are creating an internal copy of the image.
By disposing the bitmap object we are releasing the locked file.
Attached Files
File Type: zip Images.zip (4.0 KB, 44 views)
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
How to fill in the value of a combobox in a database gonzamax Questions (Windows Mobile) 2 08-10-2007 07:53 AM
Move an image inside an image control Cableguy Questions (Windows Mobile) 5 05-14-2007 07:40 PM


All times are GMT. The time now is 05:58 AM.


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