Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, The_Judge, Grant), 898 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
width / height of bmap_createblack #244366
01/04/09 10:16
01/04/09 10:16
Joined: Feb 2006
Posts: 1,011
Germany
pegamode Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
Hi,

I use the following code:

Code:
BMAP* screenshot = bmap_createblack(245,110,24);
bmap_save(screenshot,"blackpic.bmp");


I expected to get a picture with width 245 and height 110, but
I get a picture with width 256 and height 128?

Any ideas why?
The manual says:
"bmap_createblack creates a black bmap with given dimensions that can later be filled with a color."

Best regards,
Pegamode.

Re: width / height of bmap_createblack [Re: pegamode] #244367
01/04/09 10:30
01/04/09 10:30
Joined: Aug 2000
Posts: 1,140
Baunatal, Germany
Tobias Offline

Moderator
Tobias  Offline

Moderator

Joined: Aug 2000
Posts: 1,140
Baunatal, Germany
You can not make a 245x100 texture, real texture sizes must be a power of 2.

Re: width / height of bmap_createblack [Re: Tobias] #244370
01/04/09 10:34
01/04/09 10:34
Joined: Feb 2006
Posts: 1,011
Germany
pegamode Offline OP
Serious User
pegamode  Offline OP
Serious User

Joined: Feb 2006
Posts: 1,011
Germany
I don't want this bmap to be a texture ... I just want it to be a normal picture.

Re: width / height of bmap_createblack [Re: pegamode] #244458
01/04/09 20:25
01/04/09 20:25
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Ive found the same thing.
I think the bmap_create/createblack may be forcing a "power of 8" size on us.
Possible bug?

Almighty JCL... Hear our prayer...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: width / height of bmap_createblack [Re: EvilSOB] #256891
03/19/09 13:01
03/19/09 13:01
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Ancient Bump. Still no answer? I had fogotten about this.

Again, what if we want a BMAP in an odd size thats NEVER going to be used as a texture?


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: width / height of bmap_createblack [Re: EvilSOB] #256954
03/19/09 18:19
03/19/09 18:19
Joined: Mar 2009
Posts: 112
Germany
K
KDuke Offline
Member
KDuke  Offline
Member
K

Joined: Mar 2009
Posts: 112
Germany
BMAP* name = "#(width)x(height)x(bits)";
BMAP* bBlack = "#200x100x32"; // define a 200x100 pixel bitmap of 32 bits per pixel

I hope that is what you need wink

greetings
KDuke

PS: EvilSOB your a desecrator of corpses! laugh


Using A7 Free
Click and join the 3dgs irc community!
Room: #3dgs
Re: width / height of bmap_createblack [Re: KDuke] #256958
03/19/09 18:58
03/19/09 18:58
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
No good, thats a size thats fixed at compile time, I need one where the size
is decided at run-time...


PS: HEY!, it became MY corpse once Pagamode lost interest in it.
Im no desecrator, Im a re-cycler... smirk


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: width / height of bmap_createblack [Re: EvilSOB] #256970
03/19/09 19:56
03/19/09 19:56
Joined: Mar 2009
Posts: 112
Germany
K
KDuke Offline
Member
KDuke  Offline
Member
K

Joined: Mar 2009
Posts: 112
Germany
Code:
var bmpSizeX = whatever;
var bmpSizeY = whatever;
var bmpColorDepth = whatever;
STRING* bmpCreateString;
bmpCreateString = "#";

str_cat(bmpCreateString, str_for_num(NULL, bmpSizeX);
str_cat(bmpCreateString, str_for_num(NULL, "x");
str_cat(bmpCreateString, str_for_num(NULL, bmpSizeY);
str_cat(bmpCreateString, str_for_num(NULL, "x");
str_cat(bmpCreateString, str_for_num(NULL, bmpColorDepth );
BMAP* bBlack = bmap_create("#200x100x32");


That should do even in runtime wink

greetings
KDuke


Using A7 Free
Click and join the 3dgs irc community!
Room: #3dgs
Re: width / height of bmap_createblack [Re: KDuke] #256974
03/19/09 20:20
03/19/09 20:20
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Hmmm, I hadnt thought of that way... Brilliant!
Mind you, just saying BMAP* bBlack = bmap_createblack(216,325,32); would be SOOOOO MUCH easier...

Code:
var SizeX = 216;
var SizeY = 325;
var CDepth = 32;
STRING* bmpCreateString = str_create("");
str_cat_num(bmpCreateString, "#%.0fx", SizeX);
str_cat_num(bmpCreateString, "%.0fx",  SizeY);
str_cat_num(bmpCreateString, "%.0f",   CDepth );
BMAP* bBlack = bmap_create(bmpCreateString);

diag_var("\n\nWidthxHeight = %.0f, ", bBlack.width);	
diag_var("%.0f\n", bBlack.height);



"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: width / height of bmap_createblack [Re: EvilSOB] #256984
03/19/09 21:01
03/19/09 21:01
Joined: Mar 2009
Posts: 112
Germany
K
KDuke Offline
Member
KDuke  Offline
Member
K

Joined: Mar 2009
Posts: 112
Germany
It definitely would be easier if bmap_createblack would support this, I gotta agree. Though one could request that for the next update wink .

greetings
KDuke


Using A7 Free
Click and join the 3dgs irc community!
Room: #3dgs
Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | 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