|
|
width / height of bmap_createblack
#244366
01/04/09 10:16
01/04/09 10:16
|
Joined: Feb 2006
Posts: 1,011 Germany
pegamode
OP
Serious User
|
OP
Serious User
Joined: Feb 2006
Posts: 1,011
Germany
|
Hi, I use the following 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]
#244458
01/04/09 20:25
01/04/09 20:25
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
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
Expert
|
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
KDuke
Member
|
Member
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  greetings KDuke PS: EvilSOB your a desecrator of corpses! 
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
Expert
|
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... 
"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
KDuke
Member
|
Member
Joined: Mar 2009
Posts: 112
Germany
|
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  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
Expert
|
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... 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
KDuke
Member
|
Member
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  . greetings KDuke
Using A7 Free Click and join the 3dgs irc community! Room: #3dgs
|
|
|
|