Gamestudio Links
Zorro Links
Newest Posts
Max Number of Strategies in /Strategy folder
by Martin_HH. 06/17/26 07:16
Z9 getting Error 058
by jcl. 06/16/26 09:51
How to select between IB accounts by script?
by AndrewAMD. 06/13/26 15:44
Zorro tutorial ideas?
by AndrewAMD. 06/13/26 15:01
Zorro 3.01 recoded MMI function issue
by 11honza11. 06/13/26 11:40
Stooq now requires an API key
by AndrewAMD. 06/11/26 17:55
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (Martin_HH, 2 invisible), 2,992 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Student_64151, Koti, curry, DeepxKalsi, Samed
19219 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
bmap_blit with rotation and alpha parameter #248850
01/29/09 14:58
01/29/09 14:58
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Hi,

can you please add a rotation and a alpha parameter for bmap_blit in the future? That would be sweet!

Thanks,
Christian

Re: bmap_blit with rotation and alpha parameter [Re: HeelX] #248930
01/30/09 07:02
01/30/09 07:02
Joined: Jul 2000
Posts: 28,107
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,107
Frankfurt
Here it's best to use a panel with a render target. A built in engine function would not be more effective.

Re: bmap_blit with rotation and alpha parameter [Re: jcl] #249348
02/01/09 22:07
02/01/09 22:07
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Ok then tell me how to capture a render target as bitmap so that I can save it into a file without using bmap_for_screen.

Re: bmap_blit with rotation and alpha parameter [Re: HeelX] #249378
02/02/09 07:38
02/02/09 07:38
Joined: Jul 2000
Posts: 28,107
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,107
Frankfurt
Have you tried bmap_blit for copying from the render target into a normal bitmap?

Re: bmap_blit with rotation and alpha parameter [Re: jcl] #249394
02/02/09 10:16
02/02/09 10:16
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Ha! Works.

Though, it works only if you pass one frame between setting the render target and using bmap_blit. Did you mentioned that somewhere in the manual? I didn't knew.

Re: bmap_blit with rotation and alpha parameter [Re: HeelX] #249396
02/02/09 10:27
02/02/09 10:27
Joined: Jul 2000
Posts: 28,107
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,107
Frankfurt
The engine renders only once per frame, regardless if it's into a render target or on the screen. I'll mention this in the manual.

Re: bmap_blit with rotation and alpha parameter [Re: jcl] #321516
04/29/10 21:36
04/29/10 21:36
Joined: Jul 2004
Posts: 1,710
MMike Offline
Serious User
MMike  Offline
Serious User

Joined: Jul 2004
Posts: 1,710
heelx im kind stuck on that, can you show your code? capturing and rotation

Re: bmap_blit with rotation and alpha parameter [Re: MMike] #321549
04/30/10 07:11
04/30/10 07:11
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Uh... I had to dig a little bit and here is a simple example, I hope this helps! Remember to make sure that due to rotation the panel could exceed the bitmap boundaries and that the coordinates of the panel are used as offset parameter in the bitmap domain. IMPORTANT: I think bmap_save can only save solid textures, so no alpha pass is saved. If you write your own TGA code for instance (see the WIKI for an example), you can save bitmaps also with alpha transparency.

Code:
// Create a render target in which the engine renders the strign/panel/whatever
BMAP* targetBmap = bmap_createblack(width, height, 32);

// Create a panel to be rendered
PANEL* myPanel = ...;
set(panel, VISIBLE);
panel->angle = 45;

// Set previously created bitmap as render target for the panel
panel->target_map = targetBmap;

// The engine now renders the panel into the bitmap rather than on the screen
wait(1);

// Create a new bitmap with the same dimensions and colordepth as the targetBmap
BMAP* saveableBmap = bmap_createblack(targetBmap->width, targetBmap->height, 32);

// Copy the contents from the rendertarget into the new bitmap
bmap_blit(saveableBmap, targetBmap, NULL, NULL);

// Save as solid bitmap
bmap_save(saveableBmap, "panel.dds")



Last edited by HeelX; 04/30/10 07:12.
Re: bmap_blit with rotation and alpha parameter [Re: HeelX] #321562
04/30/10 09:46
04/30/10 09:46
Joined: Jul 2004
Posts: 1,710
MMike Offline
Serious User
MMike  Offline
Serious User

Joined: Jul 2004
Posts: 1,710
Exactly... thanks for your input.
but tell me.. the panel when rendering it renders with the size of the screen.. right , and if you want just the content of the panel, you need to cut the blank space ( if the panel is in the middle..) you know what i mean?

Im also getting now a faded version of the panel rendering, which is not normal??
(panel A is rendering on target B but B looks faded comparing to A...)

Re: bmap_blit with rotation and alpha parameter [Re: MMike] #321563
04/30/10 09:52
04/30/10 09:52
Joined: Jul 2004
Posts: 1,710
MMike Offline
Serious User
MMike  Offline
Serious User

Joined: Jul 2004
Posts: 1,710
i mean when i use the render bmap as

BMAP* c_crop_dest="#68x87x24"; its ok.. but the asrea that are clipped show as black.. though alpha its ok..


when i use
BMAP* c_crop_dest="#68x87x32"; the 32 alpha will make it translucid.. which is weird.. its like it need to be a black color behind it, to show properly.

Page 1 of 2 1 2

Moderated by  aztec, Spirit 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1