COMO FACO PARA LER A COR DESTE PONTO

MARCOS 08/03/2005 18:48:49
#71785
Bom dia !
Estou realizando um trabalho,na qual tenho que lidar com o Picturebox.
No entanto,surgiu a necesssidade de fazer duas coisas,que não consegui.

1.) Ler a cor de um determinado ponto,da imagem num picturebox

2.) Fazer a cor de um determinado ponto,ficar azul.


Se algum colega souber,fico grato.
GABRIEL.LOGAN 08/03/2005 19:09:30
#71792
Resposta escolhida
A 1º pergunta:

(General)

Private Declare Function GetPixel Lib "gdi32" _
(ByVal hdc As Long, ByVal x As Long, ByVal y _
As Long) As Long


+---------------------------+
|PICTURE1_MOUSEMOVE |
+---------------------------+

Private Sub Picture1_MouseMove(Button As Integer, _
Shift As Integer, x As Single, y As Single)
Label1.Caption = "Cor do ponto onde você está passando o mouse: &&H" & Hex(GetPixel(Picture1.hdc, x / Screen.TwipsPerPixelX, y / Screen.TwipsPerPixelY))
End Sub


'Ele coloca em Hexadecimal!
MARCOS 08/03/2005 20:58:39
#71804
Muito obrigado,Gabriel !
FELIPEA 08/03/2005 21:12:02
#71805
Encerre o tópico, por favor...
WEBMASTER 09/03/2005 00:07:31
#71828
ve se funfa tb Picture1.Point pra pegar a cor e Picture1.Pset pra setar um ponto com a cor rgb(r,g,b)
espero ter ajudado falou
RE.NANER 09/03/2005 09:29:52
#71853
Como eu faria algo, como LER a cor de uma imagem e carregar essa cor em um Shape??

* Não consegui carregar a cor no Shape!!!


Obriado
Tópico encerrado , respostas não são mais permitidas