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

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

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

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

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

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

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112
[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 - Sample Bitmap Code

Sample Bitmap Code

Discuss and publish sample code and applications written in OrbC (OrbForms Designer or PocketC Architect)

Postby PenreeSoft on Fri Jul 19, 2002 10:11 pm

Here is some sample code for displaying bitmaps:

<pre id=code><font face=courier size=2 id=code>
//bmp viewer

@bitmap Bitmap test {
id = 2000
image1 = "icon_l1.bmp"
image8 = "icon_l8.bmp"
}

object BMPViewer {
UIGadget gadget;
Draw draw;

void onopen();
void ondraw();


};

void BMPViewer.ondraw(){
draw.begin();
//draw.fg(240);
//draw.frame(clrFG,1,1,(gadget.w-1),(gadget.h-1),0,1);
draw.bitmap(test,50,50);
draw.end();
}

void BMPViewer.onopen(){
draw.attachGadget(gadget);
}
</font id=code></pre id=code>

Nicholas J. Penree
PenreeSoft
http://www.penreesoft.com
Nicholas J. Penree
PenreeSoft
http://www.penreesoft.com
PenreeSoft
 
Posts: 138
Joined: Sun May 26, 2002 8:14 pm
Location: USA

Postby jfield on Mon Dec 30, 2002 11:13 pm

The Orbworks 2.0.3 compiler did not like the @bitmap.

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by PenreeSoft</i>
<br />Here is some sample code for displaying bitmaps:

Code: Select all
//bmp viewer

@bitmap Bitmap test {
  id = 2000
  image1 = "icon_l1.bmp"
  image8 = "icon_l8.bmp"
}

object BMPViewer {
   UIGadget gadget;
   Draw draw;
   
   void onopen();
   void ondraw();


};

void BMPViewer.ondraw(){
draw.begin();
//draw.fg(240);
//draw.frame(clrFG,1,1,(gadget.w-1),(gadget.h-1),0,1);
draw.bitmap(test,50,50);
draw.end();
}

void BMPViewer.onopen(){
draw.attachGadget(gadget);
}


Nicholas J. Penree
PenreeSoft
http://www.penreesoft.com
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">
jfield
 
Posts: 43
Joined: Sun May 13, 2001 1:36 am
Location: USA

Postby troyk9 on Tue Dec 31, 2002 9:32 am

I did it in a more simplified fashion:

Draw pumpdraw;
void drawform(){
pumpdraw.begin();
pumpdraw.bitmap(bitmap139,10,10);
pumpdraw.end();
}

that is the code I used on the form to draw my bitmap139 at location 10,10.
I attached my bitmap to a UIgadget on the visual designer after declaring the bitmap on the bitmap screen. If you do it correctly it appears in the visual designer.
troyk9
 
Posts: 40
Joined: Mon Sep 23, 2002 12:51 am
Location: USA

Postby jfield on Wed Jan 01, 2003 1:34 pm

This time the OrbForms Designer v2.0.3 Build 136 (19 Dec 2002) compiler for the line:

"void drawform(){"

It said:

"Void is not a legal type".
jfield
 
Posts: 43
Joined: Sun May 13, 2001 1:36 am
Location: USA

Postby troyk9 on Wed Jan 01, 2003 8:43 pm

try writing that same code prior to the first handler for that form
troyk9
 
Posts: 40
Joined: Mon Sep 23, 2002 12:51 am
Location: USA

Postby jfield on Fri Jan 03, 2003 1:35 am

Okay, I'm getting closer, but how does one "attached bitmap to a UIgadget on the visual designer".

Thanks for the help so far.
jfield
 
Posts: 43
Joined: Sun May 13, 2001 1:36 am
Location: USA


Return to OrbC User Samples

Who is online

Users browsing this forum: No registered users and 1 guest

cron