a mouse question

Blitz3D Forums/Blitz3D Beginners Area/a mouse question

seferey(Posted 2005) [#1]
I made a mouse cursor and saved as a .bmp and .png

What I would like to know is. Is there a way to get rid of the white square around the mouse cursor image?

Just curious


VIP3R(Posted 2005) [#2]
Are you using 2D or 3D?

For 2D make sure you're using DrawImage and not DrawBlock...

DrawImage image,x,y

To make the white square transparent use MaskImage...

MaskImage handle,red,green,blue

...for white use red=255 green=255 blue=255

Something like this...

mousepointer=LoadImage("mouse.png")
MaskImage mousepointer,255,255,255
DrawImage mousepointer,100,200


seferey(Posted 2005) [#3]
playing with the example code but some difference

; LoadImage and DrawImage example

; Declare a variable to hold the graphic file handle
Global pic

; Set a graphics mode
Graphics3D 640,480,32

; Set drawing operations for double buffering
SetBuffer BackBuffer()

; Load the image and assign its file handle to the variable
; - This assumes you have a graphic called player.bmp in the
; same folder as this source code

pic=LoadImage("cw.png")

Maskimage pic,0,0,0

; Let's do a loop where the graphic is drawn wherever the
; mouse is pointing. ESC will exit.
While Not KeyHit(1)
Cls ; clear the screen
DrawImage pic,MouseX(),MouseY() ; Draw the image!
Flip ; flip the image into view and clear the back buffer
Wend


How do I take a square 32x32 with mouse cursor image and get rid of the white square part that's around the mouse cursor you know transparent

I'm currently using adobe photo shop 7

for tranparency but when I load up the the mouse image in b3d it shows a white square around the darn mouse cursor still annoying to me


seferey(Posted 2005) [#4]
hey over here

read above please


VIP3R(Posted 2005) [#5]
What colour is your code above masking? ...

MaskImage pic,0,0,0

... 0,0,0 = Black!

Try this instead...

MaskImage pic,255,255,255

Did you even read my post?


DH(Posted 2005) [#6]
Perhaps he should post the image so we can check the transparancy for him?

png files can be finicy on different apps (IE different to create in photoshop than in PSP, and even beteween PSP 7 and PSP 8).


seferey(Posted 2005) [#7]
maskimage pic,255,255,255


it worked but I also last night figured out what was wrong with the .png file it had transparency on it already well anyway I got the image to work correctly thanks vpier and dark half