Basic4ppc - Windows Mobile Development  

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

Questions & Help Needed Post any question regarding Basic4ppc.


Using Binary.dll... how to?


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-14-2007, 09:21 PM
Rod Rod is offline
Junior Member
 
Join Date: Aug 2007
Posts: 12
Default Using Binary.dll... how to?

I'm having trouble. How can i add a reference to BinaryFile.dll and then create an object of this type?
Reply With Quote
  #2 (permalink)  
Old 08-14-2007, 09:30 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,132
Default

Choose Tools - Components - Add Dll (Both) and add BinaryFile.dll.
Choose Tools - Add Object - BinaryFile and add the object.
See the manual: http://www.basic4ppc.com/help/binaryfile/index.html for information on working with this library.
Reply With Quote
  #3 (permalink)  
Old 08-14-2007, 09:51 PM
Rod Rod is offline
Junior Member
 
Join Date: Aug 2007
Posts: 12
Default

Thanks. Now it works... or at least compiles. But the data.dat file doesn't saver the files. :S
Don't know why. The code i have as follows:

Code:
Sub Globals

End Sub

Sub App_Start
	Form1.Show
End Sub

Sub Button1_Click
	FileOpen(c1,Encaje.Text,cRandom)
	bin.New1(c1,true)
End Sub

Sub Encajar_Click
	bin.EmbedFile (AppPath & TextBox2.Text)
	bin.EmbedFile (AppPath & "\aboutOk.png")
End Sub

Sub Button4_Click
	FileClose(c1)
End Sub
Any ideas?
Reply With Quote
  #4 (permalink)  
Old 08-14-2007, 10:41 PM
Rod Rod is offline
Junior Member
 
Join Date: Aug 2007
Posts: 12
Default

how can i creat I bin file then that contains a series of images?

Thanks
Reply With Quote
  #5 (permalink)  
Old 08-15-2007, 04:13 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,132
Default

You're code seems right except of this line:
bin.EmbedFile (AppPath & TextBox2.Text)

You should probably change it to:
bin.EmbedFile (AppPath & "\" & TextBox2.Text)
Reply With Quote
  #6 (permalink)  
Old 08-15-2007, 05:43 AM
Rod Rod is offline
Junior Member
 
Join Date: Aug 2007
Posts: 12
Default Thanks!!

Thanks!!!

I did ti, thanks. Now I can embed files in to a data.dat. Now the thing is, i have a series of images in the same data.dat. How can i retrieve them? I don't think this do the job:
Form1.Image = bin.RetrieveImage
Form1.DrawImage(bin.RetrieveImage,10,10)

Thanks again tho

Last edited by Rod : 08-15-2007 at 05:48 AM.
Reply With Quote
  #7 (permalink)  
Old 08-15-2007, 06:29 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,132
Default

I'm not sure what you want to achieve but this is what your code does:
Form1.Image = bin.RetrieveImage 'Makes the first image to be the background
Form1.DrawImage(bin.RetrieveImage,10,10) 'Draws the second image on the form at 10,10.

Note that you can use the ImageLib library for more drawing options.
Reply With Quote
  #8 (permalink)  
Old 08-15-2007, 03:54 PM
Rod Rod is offline
Junior Member
 
Join Date: Aug 2007
Posts: 12
Default

Thanks!

Last edited by Rod : 08-15-2007 at 04:03 PM.
Reply With Quote
  #9 (permalink)  
Old 12-16-2007, 12:26 PM
Newbie
 
Join Date: Dec 2007
Posts: 5
Default

This don't work with ImageButton

ImageButton1.Image = bin.RetrieveImage

Why ?

That work!!!
Image1.Image = bin.RetrieveImage
ImageButton1.Image = Image1.Image

Last edited by alexeew : 12-16-2007 at 12:42 PM.
Reply With Quote
  #10 (permalink)  
Old 12-17-2007, 02:24 PM
alfcen's Avatar
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Okinawa, Ryukyu
Posts: 424
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hello Alex

In order to minimize memory load the Image Button just references to an image. It is best to retrieve images from a binary file into an ImageList control and assign images to Image Buttons, such as

Code:
FileOpen(p1,"images.dat",cRandom)
  bin.New1(p1,true)
  For i= 0 To x
    ImageList1.Add(bin.RetrieveImage)
  Next
FileClose(p1)

ImageButton1.Image = ImageList1.Item(x)
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
Serial2 and binary transfers agraham Bug Reports 2 10-19-2008 09:19 PM
Reading binary files jgm Questions & Help Needed 5 05-28-2008 11:09 AM
Binary files on device Ianmac Questions & Help Needed 4 08-24-2007 08:49 AM
Binary File problem Ianmac Questions & Help Needed 3 08-07-2007 06:44 PM
Binary Files- Love'm and sometimes confused XerVision Questions & Help Needed 2 06-10-2007 08:55 PM


All times are GMT. The time now is 03:35 PM.


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