KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

lack of binary support in GUI end of KF .net
Goto page 1, 2  Next
 
Post new topic   Reply to topic    KiXforms Forum Index -> KiXforms.NET Discussion
View previous topic :: View next topic  
Author Message
Lonkero
KiXforms Devotee
KiXforms Devotee


Joined: 13 Mar 2003
Posts: 1022
Location: Espoo, Finland

PostPosted: Tue Jan 24, 2006 12:01 pm    Post subject: lack of binary support in GUI end of KF .net Reply with quote

yep.
I can open image or icon or whatever with fromBase64String() or fromFile but it's impossible to directly feed the binary data to the objects.

so, could you shawn add the fromStream() method or fromByteArray()?

the fromByteArray() would be usable right away, when the fromStream() would require the creation of the interdim class memoryStream.

_________________
Hammer
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Lonkero
KiXforms Devotee
KiXforms Devotee


Joined: 13 Mar 2003
Posts: 1022
Location: Espoo, Finland

PostPosted: Tue Jan 24, 2006 7:04 pm    Post subject: Reply with quote

oh, and fromStream() is a standard method of image class.
thus, you don't need to implement it with your own code, just enable it.

_________________
Hammer
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Tue Jan 24, 2006 7:19 pm    Post subject: Reply with quote

So what are we shooting for here first then ? The ability to instantiate an Image from a stream ? Want to concentrate on that first ?
Back to top
View user's profile Send private message
Lonkero
KiXforms Devotee
KiXforms Devotee


Joined: 13 Mar 2003
Posts: 1022
Location: Espoo, Finland

PostPosted: Tue Jan 24, 2006 7:47 pm    Post subject: Reply with quote

it depends.
are we going for easy or good or both?

image from stream is quick and easy.
for it to be really usable, someone (I can) needs to write the memorystream class.

on the other hand, fromByteArray() would only need the stream be constructed internally:
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemIOMemoryStreamClassctorTopic2.asp

anyway, what comes if image class is the only one where this would be implemented...
well, any class that supports external storage of information should do.
like the icon class.
can't quickly think of any others currently in kf.

_________________
Hammer
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Wed Jan 25, 2006 11:40 am    Post subject: Reply with quote

This stream stuff get complicated, how about we take first steps with support for something like:

$stream = $System.File.OpenRead("picture.jpg")

$image = $System.Image.FromStream($stream)

$Label1.Image = $image
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Wed Jan 25, 2006 11:45 am    Post subject: Reply with quote

well, File.OpenRead returns a FileStream which is kinda boring for what you want i think.
Back to top
View user's profile Send private message
Lonkero
KiXforms Devotee
KiXforms Devotee


Joined: 13 Mar 2003
Posts: 1022
Location: Espoo, Finland

PostPosted: Wed Jan 25, 2006 11:48 am    Post subject: Reply with quote

we already have filestream class there, so indeed, we can get the stream method working with current streamers too.
but if we want to make it interesting, we need to add memorystream.

_________________
Hammer
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Lonkero
KiXforms Devotee
KiXforms Devotee


Joined: 13 Mar 2003
Posts: 1022
Location: Espoo, Finland

PostPosted: Wed Jan 25, 2006 11:55 am    Post subject: Reply with quote

hmm...
ofcourse, none of these streamers return streams, so we would need to apply the superclass for the stream object and use that for all streamers to make it possible to implement...

it might well be that implementing fromByteArray() is the easiest at the moment Wink

_________________
Hammer
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Wed Jan 25, 2006 12:08 pm    Post subject: Reply with quote

k, so your suggesting we implement MemoryStream and MemoryStream.FromByteArray ?
Back to top
View user's profile Send private message
Lonkero
KiXforms Devotee
KiXforms Devotee


Joined: 13 Mar 2003
Posts: 1022
Location: Espoo, Finland

PostPosted: Wed Jan 25, 2006 12:15 pm    Post subject: Reply with quote

if we are gonna stick with pure dotnet style, then yes.
_________________
Hammer
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Lonkero
KiXforms Devotee
KiXforms Devotee


Joined: 13 Mar 2003
Posts: 1022
Location: Espoo, Finland

PostPosted: Wed Jan 25, 2006 12:16 pm    Post subject: Reply with quote

oh, and all we really need is to have the constructor as one variation initializes with byteArr (the one I linked above)
_________________
Hammer
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Wed Jan 25, 2006 12:36 pm    Post subject: Reply with quote

Just looking up some examples on the web, so what we're looking at is something like this:

$ByteArray = 0,1,255,0,0,0,1,2,3,4,10,0

$MemoryStream = $System.MemoryStream.FromByteArray($ByteArray)

$PictureBox.Image= $System.Image.FromStream($MemoryStream)
Back to top
View user's profile Send private message
Lonkero
KiXforms Devotee
KiXforms Devotee


Joined: 13 Mar 2003
Posts: 1022
Location: Espoo, Finland

PostPosted: Wed Jan 25, 2006 1:17 pm    Post subject: Reply with quote

or:
Code:

$ByteArray = 0,1,255,0,0,0,1,2,3,4,10,0

$MemoryStream = $System.MemoryStream($ByteArray)
$PictureBox.Image= $System.Image.FromStream($MemoryStream)

_________________
Hammer
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Wed Jan 25, 2006 3:12 pm    Post subject: Reply with quote

k, i am doing the base class Stream object right now - can't instantiate it as a seperate object, but will be the foundation for MemoryStream.
Back to top
View user's profile Send private message
Lonkero
KiXforms Devotee
KiXforms Devotee


Joined: 13 Mar 2003
Posts: 1022
Location: Espoo, Finland

PostPosted: Wed Jan 25, 2006 3:27 pm    Post subject: Reply with quote

k, we should (when you have time) discuss about that.
filestream and networkstream should most likely be converted to follow the "standard"

_________________
Hammer
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> KiXforms.NET Discussion All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group