From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

creating a billiard ball by bit map

hey,

i'm trying to create a billiard game.

to create the ball, i deafined int vals with GetBitmapFromFile,

my problem is that the images are rectangle and I need them to be rectangle,

but that every time i see only a squre part from the image, that way when the ball is rolling 

we see differents parts from the image.

you can think about it like  a cover image that is bare only in  a squre part

that this is ball.

thanks  and I hope someone can help with it/

0 Kudos
Message 1 of 3
(3,612 Views)

Hi Stud24,

 

Just to get a better understanding of your application, I'd like to ask a few questions.

 

1.) Is the whole billiard table represented as a bitmap image, with a certain color representing the ball?
2.) After you create the bitmap using GetBitmapFromFile, what do you do with it? In other words, which functions are you calling and passing the bitmap ID to?
3.) Are you able to pad the image with extra blank space to make the full image a square, such that the whole table is shown onscreen?

Tom D.
Staff Software Engineer
NI
0 Kudos
Message 2 of 3
(3,586 Views)

Your bitmap can contain transparent pixels This way, you can "hide" the corners of your square bitmap.

 

If you're creating the image in some image editor, you should create a .png or an .ico image, which are image types that support some form of transparency.

 

If you're creating the bitmap programmatically in CVI, using NewBitmapEx or SetBitmapDataEx, read carefully the help for the Mark and/or Alpha parameters.

 

Luis

0 Kudos
Message 3 of 3
(3,486 Views)