Skip to main content

GRIN scaling on image sequence question

2 replies [Last post]
joshw
Offline
Joined: 2008-07-28

I have a 24 frame image sequence that I'm trying to scale to a smaller size, I can get the sequence playing, and I can scale one of the images, but how do I accomplish both? I tried incorporating the two segments of code below, but it give an error of a single location setting to 24 images.

example:

#Frame animation
feature image_sequence F:R24 1250 850
"Graphics/TEST/test1_000" {
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
} ".png" repeat
;

#scaling
feature image_sequence F:R24 { ( left 1250 top 850 scale 800 800 mills ) }
""Graphics/TEST/test1_000" {
01
} ".png"
;

thanks,

Josh

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Bill Foote

bd-j-dev@mobileandembedded.org wrote:
> I have a 24 frame image sequence that I'm trying to scale to a smaller size, I can get the sequence playing, and I can scale one of the images, but how do I accomplish both? I tried incorporating the two segments of code below, but it give an error of a single location setting to 24 images.
>
> example:
>
> #Frame animation
> feature image_sequence F:R24 1250 850
> "Graphics/TEST/test1_000" {
> 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
> } ".png" repeat
> ;
>
> #scaling
> feature image_sequence F:R24 { ( left 1250 top 850 scale 800 800 mills ) }
> ""Graphics/TEST/test1_000" {
> 01
> } ".png"
> ;
>
> thanks,
>
> Josh
> [Message sent by forum member 'joshw' (joshw)]

Using a list for the placement of the images. The BNF syntax in
doc-files/index.html is a little terse, but the relevant part is:

image_sequence ::= "feature" "image_sequence" name image_seq_placement
file_name "{" name_or_continuation * "}"
extension [ "repeat" ]
[ "scaling_model" name ]
( "model" feature_name | image_seq_end ) ";"

image_seq_placement ::= image_placement | "{" image_placement* "}"
# if there is a list of image placements in a image_sequence,
# it must have the same length as the images array.

So that comes out something like:

#Frame animation with scaling
feature image_sequence F:R24 {
( left 1250 top 850 scale 1000 1000 mills )
( left 1250 top 850 scale 950 950 mills )
... Like that 22 more times, maybe with different values ...
}
"Graphics/TEST/test1_000" {
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
} ".png" repeat
;

There's another way to do scaling, too: You can attach a scaling_model to
this and other feature types. That's good if you want to scale a bunch of
features in tandem, as is done when the entry keyboard spins around on the
bookmenu xlet, after you successfully enter "BLURAY" to get the bonus
content.

Cheers,

Bill

---------------------------------------------------------------------
To unsubscribe, e-mail: bd-j-dev-unsubscribe@hdcookbook.dev.java.net
For additional commands, e-mail: bd-j-dev-help@hdcookbook.dev.java.net

joshw
Offline
Joined: 2008-07-28

Thanks Bill, that worked great. I am going to check out the keyboard spin to figure out the scaling model method.

Josh