Page 1 of 1

PostPosted: Fri Jul 19, 2002 10:11 pm
by PenreeSoft
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

PostPosted: Mon Dec 30, 2002 11:13 pm
by jfield
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">

PostPosted: Tue Dec 31, 2002 9:32 am
by troyk9
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.

PostPosted: Wed Jan 01, 2003 1:34 pm
by jfield
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".

PostPosted: Wed Jan 01, 2003 8:43 pm
by troyk9
try writing that same code prior to the first handler for that form

PostPosted: Fri Jan 03, 2003 1:35 am
by jfield
Okay, I'm getting closer, but how does one "attached bitmap to a UIgadget on the visual designer".

Thanks for the help so far.