Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - Help with SaveBmp and @res

Help with SaveBmp and @res

A PocketC native palm library offering native forms and assorted utilities

Postby Int21h on Mon Jul 18, 2005 12:55 am

This is driving me nuts! I am trying to work with Bitmaps, creating a database and loading them in (to eventually use for scrolling.) I am using the following code to create a database but it doesn't work right.

@cid "JN00";
@name "SBuffer";
@dbname "SBuffer";
@bmp "1200,1,Pic.bmp,4,Pic.bmp";
library "PToolboxLib"
main(){
SetDepth(5);
graph_on();
clearg();
bitmapr(1200, 0, 0);
OpenBmpDb("test_bitmap");
SaveBmp(1000, 0, 0, 160, 160, -1, 0);
}
First of all, the function is returning 0 instead of 1000. Secondly, any BmpInfo command returns all zeros for width, height etc. But when I use the following code (in a seperate program) to read the bitmap database, it loads the image but it is shrunk to 1/4 size and shown twice along the top. It almost seems like a shrink funtion is being used or when the above code is run it is saving two smaller versions instead of one:

main(){
SetDepth(5);
graph_on();
clearg();
if(!OpenBmpDb("test_bitmap")) {
alert("Failed to find test_bitmap.prc!");
exit(); }
FastBmp(0, 0, 1000);
}
Can someone please help?
Int21h
 
Posts: 14
Joined: Tue Jun 21, 2005 8:04 pm

Postby jstadolnik on Mon Jul 18, 2005 2:53 am

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
First of all, the function is returning 0 instead of 1000.
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">

If SaveBmp fails it returns -1. If it doesn't fail it returns the resource index (which is not the same as resource id). If you got a zero back it means that you created a bitmap with at id zero (which means the first bitmap in the file). The second bitmap will have an index of 1 and so on. Each bitmap also has a unique resource id... so each bitmap has a resource index and id.

BmpInfo requires you to input the resource index as the first parameter, my guess is that you're plugging in the resource id instead?

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
But when I use the following code (in a seperate program) to read the bitmap database, it loads the image but it is shrunk to 1/4 size and shown twice along the top. It almost seems like a shrink funtion is being used or when the above code is run it is saving two smaller versions instead of one
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">

This may be a palmOS 5 bug (or maybe a bug in my code... though I had no other reports of such). I would suggest trying this out on the palmOS emulator running a m505 or IIIc, does it work? I heard of cases where newer devices don't fully support 4 bit graphics mode. What does "puts(hex(SetDepth(-1)));" return on your device? This will return a code indicating what depths your device supports.

If you save less of the fullscreen (less than 160x160) does this change things?

-Joe



The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Postby Int21h on Mon Jul 18, 2005 6:19 pm

Ah, that's the confusion. Thank you so much for the help (and all of the help you give everyone. You really go out of your way)

I assumed the ID and index were the same. I will experiment with this shortly. What I think is really weird is that the FastBmp statement worked at all when I used the resource id and not the index id...

As far as the shrinking thing, I think it may be a simulator bug. I currently have a ROM for a Treo 600 (my phone.) Can you tell me where I can get other ROMs (especially the m505 or IIIc)? I can't seem to find them on Palmsource, and PalmOne only has Treo ROMs with simulators attached. As soon as I can find a ROM I will test your suggestions.
Int21h
 
Posts: 14
Joined: Tue Jun 21, 2005 8:04 pm

Postby jstadolnik on Mon Jul 18, 2005 11:59 pm

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
I assumed the ID and index were the same. I will experiment with this shortly. What I think is really weird is that the FastBmp statement worked at all when I used the resource id and not the index id...
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">

FastBmp actually works both ways. If the id number is <1000, it's treated as a resource index, if it's 1000 or higher, it's treated as a resource id.

To get to the emulator and roms, use the quick links selector box on left side of the palmsource.com developer's page. You'll probably have to register as a developer.

http://www.palmos.com/dev/tools/emulator/

-Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA


Return to Pocket Toolbox

Who is online

Users browsing this forum: No registered users and 0 guests

cron