FBImage static Win/Lin 32/64-bit

External libraries (GTK, GSL, SDL, Allegro, OpenGL, etc) questions.
Roland Chastain
Posts: 845
Joined: Nov 24, 2011 19:49
Location: Dakar, Senegal
Contact:

Re: FBImage static Win/Lin 32/64-bit

Postby Roland Chastain » May 05, 2018 20:08

@Joshy

How can I get a (rectangle) part of an image? The image is loaded with LoadRGBAFile().

Thank you.
D.J.Peters
Posts: 7429
Joined: May 28, 2005 3:28

Re: FBImage static Win/Lin 32/64-bit

Postby D.J.Peters » May 05, 2018 21:05

Roland Chastain wrote:How can I get a (rectangle) part of an image? The image is loaded with LoadRGBAFile().
Same as before with the GET command :-)
https://www.freebasic.net/wiki/wikka.ph ... etgraphics

e.g.
var LoadedImage = LoadRGBAFile("blabla.bla")
var NewImage = ImageCreate(100,100)
Get LoadedImage, (x,y) - STEP(99,99), NewImage

NOTE: !!! STEP(99,99) not STEP(100,100) !!!
Ask if you run in to trouble.

Joshy
Roland Chastain
Posts: 845
Joined: Nov 24, 2011 19:49
Location: Dakar, Senegal
Contact:

Re: FBImage static Win/Lin 32/64-bit

Postby Roland Chastain » May 05, 2018 21:44

@Joshy

Perfect, thank you.
D.J.Peters
Posts: 7429
Joined: May 28, 2005 3:28

Re: FBImage static Win/Lin 32/64-bit

Postby D.J.Peters » May 05, 2018 22:06

For advanced use I created PutResize
you can cut a part of Image or Screen
optional scale it and put the result to Image or Screen
viewtopic.php?f=7&t=26672

MultiPut V2 optional scale and rotate Image and put the result on Screen or Image
viewtopic.php?f=7&t=24479&p=220305

Draw perspective correct Image as polygon 2D/3D
viewtopic.php?f=7&t=26090

Of course you can combine them.
Load an Image with FBImage
get a part of the loaded image with PutResize (optional scale it down or up)
put it rotated on the Screen or Image with Multiput V2
...

Joshy

Return to “Libraries”

Who is online

Users browsing this forum: No registered users and 3 guests