Basic4ppc - Windows Mobile Development  

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

Code Samples & Tips Share your recent discoveries and ideas with other users.


Embed and retrieve images in a data file


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-15-2008, 06:58 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,185
Default Embed and retrieve images in a data file

Two small programs are included in the attached files.
CreateImagesFile - Embeds a list of image files in a data file.
ReadImages - Loads the images from the data file into an ImageList.

You could use these programs to create a single data file instead of many image files.
ReadImage code should be added to your program code.
Attached Files
File Type: zip ImagesFile.zip (7.1 KB, 134 views)
Reply With Quote
  #2 (permalink)  
Old 01-23-2008, 07:26 PM
Junior Member
 
Join Date: Jan 2008
Posts: 10
Default Extraction

hey when the pics go into the .dat is there a way or code to extract them??
Reply With Quote
  #3 (permalink)  
Old 01-23-2008, 07:37 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,185
Default

Yes. See the ReadImages file.
Reply With Quote
  #4 (permalink)  
Old 01-23-2008, 08:46 PM
Junior Member
 
Join Date: Jan 2008
Posts: 10
Default

what i mean is when they are in the dat file i dont want to bring em in the program i want to beable to extract back to the desktop
Reply With Quote
  #5 (permalink)  
Old 01-24-2008, 05:50 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,185
Default

You should use BinaryFile.RetrieveFile instead of BinaryFile.RetrieveImage.
Reply With Quote
  #6 (permalink)  
Old 01-25-2008, 01:25 AM
Junior Member
 
Join Date: Jan 2008
Posts: 10
Default

can you make a source code or is there 1 already made
im mostly new to this and i made a mistake of deleting the photos i put in the dat now i need to bring em out

Last edited by cosmo15900 : 01-25-2008 at 03:06 AM.
Reply With Quote
  #7 (permalink)  
Old 01-25-2008, 06:09 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,185
Default

This should do it:
Code:
Sub Globals
    'Declare the global variables here.

End Sub

Sub App_Start
    RetrieveFiles("Images.Dat")
End Sub

Sub RetrieveFiles (file)
    FileOpen(c,file,cRandom)
    bin.New1(c,false)
    num = bin.ReadInt32 'read the number of images.
    For i = 1 To num
        bin.RetrieveFile("file" & num & ".dat")
    Next
    FileClose(c)
End Sub
Files will be named: file1.dat, file2.dat, ...
Reply With Quote
  #8 (permalink)  
Old 01-26-2008, 12:13 AM
Junior Member
 
Join Date: Jan 2008
Posts: 10
Default

sweet thanks
Reply With Quote
  #9 (permalink)  
Old 02-17-2008, 04:43 PM
Knows the basics
 
Join Date: Jan 2008
Posts: 53
Default Transparency

it doesn't work when the Imagebutton is transparency. Is there a way?
Reply With Quote
  #10 (permalink)  
Old 02-17-2008, 04:46 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,185
Default

This is a bug that will be fixed in the next version.
For now you can use one of the workarounds mentioned in this thread: Image problem with ImageButtons
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
retrieve images and index lux1963 Questions & Help Needed 3 05-18-2008 02:42 PM
Embed your images into a .DAT file with this builder Oran Share Your Creations 28 05-15-2008 10:58 AM
Embed images in the exe alfcen Basic4ppc Wishlist 2 03-22-2008 12:46 PM
Exe embedded data file and, Icon personalisation. dan kabestan Questions & Help Needed 3 01-15-2008 12:08 PM
Large Txt or data file tcgoh Questions & Help Needed 4 05-29-2007 02:37 AM


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


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