Ir para conteúdo
Fórum Script Brasil

Casalechi

Membros
  • Total de itens

    3
  • Registro em

  • Última visita

Sobre Casalechi

Casalechi's Achievements

0

Reputação

  1. o codigo esta em um timer com interval de "1000" é um reconhecimento de img mas quando dentro de um timer ele consome muita memoria até dar erro! preciso de uma ajuda para otimizar, preciso esvaziar a memoria quando o codigo chega ao fim ou coisa do tipo tentei varias coisa mais nada funcionou o desafio foi lançado! help me plx Try Dim bmpSource2 As Bitmap = New Bitmap("C:\Users\USER\Pictures\ox\others\efeito.bmp") Dim bmpScreen2 As Bitmap = New Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height) Dim clrScreen, clrUL, clrUR, clrLL, clrLR As Color 'capture screen Using g As Graphics = Graphics.FromImage(bmpScreen2) g.CopyFromScreen(0, 0, 0, 0, bmpScreen2.Size) End Using clrUL = bmpSource2.GetPixel(0, 0) clrUR = bmpSource2.GetPixel(bmpSource2.Width - 1, 0) clrLL = bmpSource2.GetPixel(0, bmpSource2.Height - 1) clrLR = bmpSource2.GetPixel(bmpSource2.Width - 1, bmpSource2.Height - 1) For x = 1000 To 1100 For y = 300 To 350 clrScreen = bmpScreen2.GetPixel(x, y) If clrScreen = clrUL Then 'found the upperleft pixel check upper right clrScreen = bmpScreen2.GetPixel(x + bmpSource2.Width - 1, y) If clrScreen = clrUR Then clrScreen = bmpScreen2.GetPixel(x, y + bmpSource2.Height - 1) If clrScreen = clrLL Then clrScreen = bmpScreen2.GetPixel(x + bmpSource2.Width - 1, y + bmpSource2.Height - 1) If clrScreen = clrLR Then 'Se achar varial = varial + 1 End If End If End If End If Next Next Catch ex As ArgumentException MsgBox("deu ruim") Exit Sub End Try End Sub
  2. Casalechi

    Ajuda com teclas?

    1- PRIMEIRO COLOQUE PARA RODAR EM SEGUNDO PLANO Dei uma procurada pro cima como rodar vba em segundo plano http://www.ehow.com.br/rodar-subrotinas-visual-basic-segundo-plano-como_9885/ 2- CRIE UM FORM 3- CRIE UM TIMER (só clicar e arrastar ele para dentro do Form1) 4-NO FINAL DO SCRIPT A BAIXO TEM O QUE VOCE PROCURA,BASTA EDITAR AS LETRAS., ACHO QUE VAI FUNCIONAR Public Class Form1 Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) AsInteger Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles MyBase.Load Timer1.enabled = true Timer1.interval = 1 End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles Timer1.Tick Dim crtlkey As Boolean ctrlkey = GetAsyncKeyState(Keys.ControlKey) If ctrlkey = True Then SandKeys "vel" End If End Sub
  3. Estou criando um corretor de bug e preciso realizar algumas funçoes como ir até uma pasta, abrir um arquivo e clicar em um determinado botao tudo isso em "hide" pois seria mt feio o usuario ver toda essa movimentaçao, usei os codigos a baixo mais não deu certo preciso de alguma soluçao com explicação ficarei mt grato! Shell("C:\programa\configuraçao\config.exe", vbHide) Shell.SendKeys("MOVETO, 100 , 200") Shell.SendKeys("{CLICK , 100 , 200}") erro foi aqui (eu tentei esses 2 codigos a baixo mas n deu certo ) Shell.SendKeys("MOVETO, 100 , 200") Shell.SendKeys("{CLICK , 100 , 200}")
×
×
  • Criar Novo...