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 - bitmap commands

bitmap commands

Discuss PocketC for CE (including Desktop Edition)

Postby rawn shea on Tue Jun 12, 2001 10:32 am

could anyone provide a description of the differences between the 3 commands used to draw bitmap images and also a sumnmary of the flags? it seems some flagfs do nothing and others are duplicates of each other. here ios a tool i wrote to play with the variables. also FYI i am using 1 4 color bitmap editor on a 256 color device
//----code follows--//
#include "\\PocketC\\include\\pcheader.h"
#define EXIT 110
#define XPOS 111
#define YPOS 112
#define BITMAP 115
#define XPOSVAL 116
#define YPOSVAL 117
#define BMVAL 120
#define DRAW 121
#define FLAG 122
#define FLAGVAL 123
#define BMPATH "\\PocketC\\bitmp\\"
int evnt;
int xval;
int yval;
string bmval;
int flag;
string bmfull;
main()
{
//initialize variables
xval=40;
yval=40;
flag=0;
bmval="arrow_up";
//first make the buttons
createctrl("BUTTON","EXIT",WS_VISIBLE | WS_CHILD,0,590,180,45,20,EXIT);
createctrl("BUTTON","xpos",WS_VISIBLE | WS_CHILD,0,590,160,45,20,XPOS);
createctrl("BUTTON","ypos",WS_VISIBLE | WS_CHILD,0,590,140,45,20,YPOS);
createctrl("BUTTON","bitmap",WS_VISIBLE | WS_CHILD,0,590,120,45,20,BITMAP);
createctrl("BUTTON","flag",WS_VISIBLE | WS_CHILD,0,590,100,45,20,FLAG);
createctrl("BUTTON","draw",WS_VISIBLE | WS_CHILD,0,590,80,45,20,DRAW);
//next draw edit boxes
createctrl("EDIT"," ",WS_VISIBLE | WS_BORDER,0,500,160,90,20,XPOSVAL);
createctrl("EDIT"," ",WS_VISIBLE | WS_BORDER,0,500,140,90,20,YPOSVAL);
createctrl("EDIT"," ",WS_VISIBLE | WS_BORDER,0,500,120,90,20,BMVAL);
createctrl("EDIT"," ",WS_VISIBLE | WS_BORDER,0,500,100,90,20,FLAGVAL);
//enter initial values into edit boxes
editset(XPOSVAL,xval);
editset(YPOSVAL,yval);
editset(BMVAL,bmval);
editset (FLAGVAL, flag);
//next post the flag values to the console for reference
putsl("0=copy");
putsl("1=invert");
putsl("2=invert");
putsl("3=paint or");
putsl("4=erase");
putsl("5=notsrcopy");
putsl("6=notsrerase");
putsl("7=mergecopy");
putsl("8=mergepaing");
putsl("9=patcopy");
putsl("10=patpaint");
putsl("11=patinvert");
putsl("12=dstinvert");
putsl("13=black");
putsl("14=white");
//next make the decision loop
flushevent();
event(1);
evnt=guiid();
while (evnt != EXIT)
{
switch (evnt)
{
case XPOS:guisetfocus(XPOSVAL);break;
case YPOS:guisetfocus(YPOSVAL);break;
case BITMAP:guisetfocus(BMVAL);break;
case FLAG:guisetfocus(FLAGVAL);break;
case DRAW:
xval=(int)(editget(XPOSVAL));
yval=(int)(editget(YPOSVAL));
flag=(int)editget(FLAGVAL);
bmval=editget(BMVAL);
bmfull=BMPATH+bmval+".2bp";
drawbitblt(bmfull,xval,yval,flag);
break;
}
sleep(450);
flushevent();
event(1);
evnt=guiid();
}
quit();
}
rawn shea
 
Posts: 12
Joined: Wed Mar 07, 2001 6:35 pm

Postby Justinespinosa on Tue Jun 12, 2001 2:35 pm

The 3 bitmap functions:

1) drawbitmap(string file,int x,int y): draw a bitmap that's in the Windows bitmap file format (*.bmp; *.2bp). it supports 2;4;8 bit indexed colors and True color bitmaps. even if it's compressed.
2) drawbitblt(string file,int x,int y,int flag): same as 1) but plot the point of the bitmap with a special opertaor (flag).
It goes so:
i.e. if the operator is XOR, the point from the bitmap is red,
and the point on the screen is white:
bitmap |XOR| screen | result
===============================================
R:11111111 |XOR|11111111 |00000000
G:00000000 |XOR|11111111 |11111111
B:00000000 |XOR|11111111 |11111111

and so it makes CYAN.

sometimes it makes more than one operator (i.e. bitmap AND (NOT screen) ).
You can find in the V3 documentation which flag makes which operation.

3) drawimage(string file,int x,int y,int w,int h,int sizeratio,int flag) can draw not compressed windows bitmap (*.bmp, *.2bp); JPEG bitmaps(*.jpg) and Compuserve GIF (*.gif). It has the same flag than the 2) and it's able to minimize the size of the image (with w an h or sizeratio).

But please take a look in the documentation. It's all explained ...


J.Espinosa

OUTS Softwares

Edited by - justinespinosa on 06/12/2001 09:36:27
J.Espinosa

OUTS Softwares
Justinespinosa
 
Posts: 156
Joined: Wed Dec 06, 2000 2:30 pm
Location: Switzerland

Postby ianf on Thu Jun 14, 2001 10:39 am

<font face=Tahoma></font id=Tahoma>It's also worth mentioning that drawimage can scale down the way from 100% so you can make images smaller though not larger. Also note that jpg's while smaller do take much longer to appear as the system has to de-compress the picture.
drawbitblt can be used to erase an image previously drawn using the correct flag.
Note that none of these gives you a transparent bitmap which can be drawn on top of a background.
Ian
ianf
 
Posts: 92
Joined: Mon Dec 11, 2000 7:25 am
Location: United Kingdom

Postby rawn shea on Thu Jun 14, 2001 10:41 am

Are we "XORING" the bitmap with itself or with the background?
rawn shea
 
Posts: 12
Joined: Wed Mar 07, 2001 6:35 pm

Postby Justinespinosa on Thu Jun 14, 2001 11:28 am

With the background

J.Espinosa

OUTS Softwares
J.Espinosa

OUTS Softwares
Justinespinosa
 
Posts: 156
Joined: Wed Dec 06, 2000 2:30 pm
Location: Switzerland


Return to PocketC for CE

Who is online

Users browsing this forum: No registered users and 1 guest

cron