Pictures in Objects

Hello

I have problems with pictures in objects.
A) After reading the blog on ‘SUPPORT OF PICTURES IN OBJECTS’ I expected this line of code should work:

TRANSFORM PICTURE(OB Get(obTest;"Bild");Scale;0.5;0.5)

but I get an error (‘field, variable or parameter expected’). >Product :4D - 4D Server

OS : Mac OS X

on the other hand, this line works:

PICTURE PROPERTIES(OB Get(obTest;“Bild”);$Breite;$Hoechi)

B) I have an entity and would like to assign a picture to it’s ‘Bild’-attribute. this works fine.
But if I first crop the picture with ‘TRANSFORM PICTURE’ I cannot assign it to the entity anymore:

obDing.Bild:=$Picture              

works fine

    TRANSFORM PICTURE($Picture;crop;10;10;10;10)
    obDing.Bild:=$Picture               

nothing happens

it works fine with a ‘normal’ object:
TRANSFORM PICTURE($Picture;crop;10;10;10;10)
obTest:=$Picture
works fine

Can anybody help me with this?

: Barbara FURRER

TRANSFORM PICTURE(OB Get(obTest;“Bild”);Scale;0.5;0.5)

Object-properties are not variables. So you have to pass a variable to the command and then assign it to an object property.

Thank you for your reply. But in this case I do not understand this quote from the 4D Blog:

“You can use a picture attribute in all the commands of the “Picture” theme. For example:
PICTURE TO BLOB(OB Get($obj;“avatar”);$blob;“image/jpeg”)”

And do you have any idea concerning my second problem? I have not found a workaround yet…

The second issue seems to be a bug. What does it mean; “Nothing happens”? Do you mean, the picture isn’t cropped?

I mean: The transformation of the picture variable works as it should, the picture is cropped. But the cropped picture variable cannot be assigned to the object attribute, if the object is an entity of an entitySelection.
If the picture is transformed with scale instead of crop, it can be assigned to the object attribute.

Both the cropped or the scaled picture variable can be assigned to a normal object, i.e. one declarated with C_object.

But the entity object doesn’t even accept it from the other object. So I have found no way to assign a cropped picture to the entity object.

: Barbara FURRER

But the cropped picture variable cannot be assigned to the object
attribute

Again, what does it mean? An error is thrown? The picture is un-cropped? The picture is empty?

Thanks for persisting, sorry if I have been unclear.

The picture attribute “Bild” of the entity obDing remains empty, as you can see in the screenshot below.
No error, the picture is cropped and scaled correctly.

(The method ‘BildUfDVDaapasse’ performs ‘TRANSFORM PICTURE’ once to scale and then again to crop the picture.)

[]27418551;“Your comment here…”[/]

Then please open a TAOW-case for this.