Who can help me storing pictures

Hai,

I have a picture stored on hd and want to pick it up and store it in the firebird db. How can I do this?

Thanks,

Marcel

  1. go into designer and create an imageField(fieldtype MEDIA)
  2. place the imageField in your form and set the “display type” property to IMAGE_MEDIA
  3. go back into data mode and rightclick in the imageField.
  4. a popup will show, choose “load image” and browse your HD to desired image

Oh no, not that simple :oops:

Thanks again!

Maarten,

Maybe not so simple after all, on OS X…
(or right mouseclick) doesn’t do the trick on OS X…

Sorry,

Marcel

Hi Marcel,

What version of Servoy are you running? The click works on my OS X box (I was using 1.2rc5 beta version). At first, it didn’t, but it was due to the fact that I didn’t set the display type property of the field to Media in design mode. Once I did that, worked like a charm.

Good luck,
Adam

Adam,

I use the same version and… I am/was sure I had changed the data type. But, thanks to your tip I found this was’nt the case (anymore :lol: ).

Thanks again,

It works now!

Ciao,

Marcel

Correct me if I’m wrong but click on OSX is going to be changed into click like it should be on a Mac in a new(er) release (read in another topic)

That is what I heard too, and what I hope is going to happen in the near future but this is not a Servoy thing but an Apple thing (they messed some ‘apple beaty’ up with their latest java release…

You can also create a method and attach it to a button to load an image into a dataprovider. That way, you don’t have to worry about or right clicking at all. Here’s one that I use:

var rawData = application.readFile();
if (rawData != null)
{
imagefield = rawData;
}

What this does is pull up a window that lets me browse to the image file I want, then loads the file into my variable ‘rawData’. From ‘rawData’ I can then set my imagefield to the variable. You could go directly into the imagefield, but if you select cancel when choosing a file, it will clear the contents of the imagefield. This allows me to make sure I have something to put into that dataprovider.

Also, a quick thanks to the Servoy development team. Without the sample codes, it would’ve been a lot harder to figure out.

Adam

Adam, that’s great!

dave lundgren, wandering past 8)

Thanks adam, but this is exactly what I did at first. The result was a java message instead of an image. That is why I thought this was wrong…

But, I will try again!

Ciao,

Marcel

Servoy release 1.2 rc6 has file to media field drop support.

var rawData = application.readFile();
if (rawData != null)
{
imagefield = rawData;
}

I’ve been trying for almost 2 days to figure out how to
accomplish this (reading raw image data and dropping
it into a media object to display the image).

Is this kind of information available anywhere?

Are there documents I’m missing? or is this a normal
thing to do in java?

See here: http://forum.servoy.com/viewtopic.php?t=1005

HJK:
See here: http://forum.servoy.com/viewtopic.php?t=1005

thank you, hjk.

the real question I’m asking is, how do I find out about
capabilities like this? not just in the case of image media,
but throughout servoy in general.

I downloaded two pdf docs: ServoyDev1_2_1D_v7.pdf and
ServoyAdvProgGuide_v9.pdf, but many of the things I’ve
been trying to do with servoy aren’t documented there.

am I missing some documentation?

thanks.
rm

Javascript docs could help you (not Java). Reading all releasenotes that accompany all releases sure will help you and offcourse this forum.

I can imagine that with the speed of Servoy developing (and the developers themselves) it is almost impossible to keep the docs in shape.

So: no you don’t miss anythign (as far as I know)… Or I have missed something and that is very well possible since I only work with Servoy for about three months now. :D

Hey Robert,

I started putting together a Servoy tips n’ tricks file that starts showing how to do things in Servoy and demonstrates some of it’s built in capabilities. Check out my posting in HOW TOs section.

http://forum.servoy.com/viewtopic.php?t=1059

hope this is helpful.
Adam