March 28, 2024, 01:54:21 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Region buttons

Started by Andy, May 05, 2021, 04:05:06 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andy

Hi,

Can someone tell me what's wrong here:

I'm working on region buttons, (project build), when I do this...

CONTROL w1,@RGNBUTTON,"",450,150,50,20,0x50000000,2
uint hrgn1[1] = rgnfrombitmap(585)
SETBUTTONRGN w1,2,hrgn1[1]
SETBUTTONBITMAPS w1,2,bmp,bmp,0
SETBUTTONBORDER w1,2,0

the bitmap is shown correctly.

But when I do this it doesn't...

CONTROL w1,@RGNBUTTON,"",450,150,50,20,0x50000000,2
hrgn[1] = rgnfrombitmap(585)
SETBUTTONRGN w1,2,hrgn[1]
SETBUTTONBITMAPS w1,2,bmp,bmp,0
SETBUTTONBORDER w1,2,0

I have hrgn defined as UINT hrgn[100]

Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Andy

This is very strange.

If I say:

hrgn = rgnfrombitmap(585)

then use

SETBUTTONRGN w1,2,hrgn - it's not shown - well only a small dot.

If I use

SETBUTTONRGN w1,2,hrgn[1234] (any number > 0) it's shown correctly?
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Andy

The problem is this:

If I have say 100 images, at the moment I would need 100 UINT's.

Okay, I can work with that but surely there is a way to make just one UNIT store  all the regions?

Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Brian

Andy,

Look at your Hangman game to see how you loaded multiple region buttons

Brian

Andy

Thanks Brian,

There I am doing exactly what I want to do here except they are all the same shape in the game.

It doesn't work here, I have double checked my include file and there's nothing there that would cause this.

Andy.

 
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

LarryMc

I tried everything I know to try and I don't know why it isn't working.
Sorry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Andy

May 05, 2021, 11:09:38 PM #6 Last Edit: May 05, 2021, 11:12:11 PM by Andy
Thanks for trying.

Got up this morning determined to find out the problem.

There were actually two things going on,

1. For some reason when I use the colour black the bitmap goes transparent (no idea), this is not an issue but still a puzzle.

2. There was a control number conflict buried deep inside a sub routine, so I changed one of my control numbers.

So changing the control number and bitmap colour solved this little one - phew!

Thanks,
Andy.
:)
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.