mateusb Posted June 10, 2012 at 03:55 PM Report Share #461785 Posted June 10, 2012 at 03:55 PM olá pessoal! por favor me ajude! gostaria de saber se tem algum evento que detecta se uma picturebox(ou qualquer outro controle) está tocando em outra, ou eu tenho que fazer isso em código mesmo... 😁 Link to comment Share on other sites More sharing options...
petvetbr Posted June 10, 2012 at 04:29 PM Report Share #461791 Posted June 10, 2012 at 04:29 PM Que eu saiba precisa ser feito no código mesmo. Mas não é difícil, basta verificar os limites de um controle com os outros. Fernando Lage Bastos - MCP/MCTS/MCPD Link to comment Share on other sites More sharing options...
mateusb Posted June 10, 2012 at 05:21 PM Author Report Share #461800 Posted June 10, 2012 at 05:21 PM ok, você tem algum exemplo? Link to comment Share on other sites More sharing options...
ribeiro55 Posted June 11, 2012 at 12:30 AM Report Share #461868 Posted June 11, 2012 at 12:30 AM Todos os controlos podem ser definidos por um rectângulo. Depois, a classe Rectangle, namespace Drawing, tem um método chamado Intersects que tem outro rectângulo como parâmetro. Isto serve precisamente para verificar se um rectângulo está a intersectar com o outro. Sérgio Ribeiro "Great coders aren't born. They're compiled and released""Expert coders do not need a keyboard. They just throw magnets at the RAM chips" Link to comment Share on other sites More sharing options...
mateusb Posted June 12, 2012 at 10:22 PM Author Report Share #462382 Posted June 12, 2012 at 10:22 PM ok, mas é possivel fazer uma forma do tamanho EXATO da imagem do picturebox? já que gostaria de fazer um jogo, e nem todos os elementos são quadrados, então as bordas, afetariam... Link to comment Share on other sites More sharing options...
RGanhoto Posted June 14, 2012 at 01:43 PM Report Share #462777 Posted June 14, 2012 at 01:43 PM Para fazer tal proeza é preciso em primeira fase. para não ocupar muito processador. Verificar se 2 rectângulos se tocam, como já foi dito. Se isso ocorrer, deve-se verificar pixel a pixel nas imagens para ver se os pixeis que se tocam são transparentes ou não.. Cumprimentos Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now