Ir para conteúdo
Fórum Script Brasil

shafick

Membros
  • Total de itens

    6
  • Registro em

  • Última visita

Sobre shafick

shafick's Achievements

0

Reputação

  1. Fato! Não há o que fazer. A limitação é do próprio equipamento. Obrigado. Seus comentários foram de grande ajuda para minhas dúvidas. Paz ae brother. Valeu!
  2. Foi o que fiz primariamente, mas estranhei prq só não obtive erro em 75, 100, 200 e 300 (não testei acima de 300 pois não me interessa). Será que a informação está correta? Minha multifuncional HP 2544 não suporta 150 DPIs (era o valor desejado). Te parece comum estes intervalos? É a primeira vez que lido com digitalização. Não tenho ideia se é comum.
  3. Boas! Talvez também saiba me dar uma luz neste problema:
  4. Salve pessoal! Estou obtendo o erro "O valor não recai no intervalo esperado." quando tento definir a propriedade DPI com determinados valores. Se defino para 75, 100 ou 300 DPIs, não há problemas, mas se tento, por exemplo, 150 DPIs, acontece o erro acima. Alguém pode me explicar se existe um range fixo de DPIs suportado ou se este range varia de scanner para scanner? Como posso obter o range suportado? Obrigado. 'chamada AdjustScannerSettings(item, 120) Public Sub AdjustScannerSettings(scannnerItem As IItem, scanResolutionDPI As Integer) Const WIA_HORIZONTAL_SCAN_RESOLUTION_DPI As String = "6147" Const WIA_VERTICAL_SCAN_RESOLUTION_DPI As String = "6148" End Sub Public Sub SetWIAProperty(properties As IProperties, propName As Object, propValue As Object) properties(propName).let_Value(propValue) End Sub Usando VB.net / 2013
  5. Valeu Graymalkin. Após a correção de meu erro deu tudo certo. Obrigado.
  6. Boas! Estou usando o Microsoft Windows Image Acquisition Library v2.0 (WIA) para digitalizar imagens. Porém, cada imagem está ficando com 25mb em média (jpg, bmp, png, gif ou tiff da na mesma). A ideia é converter para PDF após a digitalização; mesmo assim, o arquivo PDF está ficando com 8mb em média. Pensei então em diminuir a resolução da imagem digitalizada, mas estou encontrando dificuldade para lidar com essa propriedade. Alguém pode ajudar? Ou sugerir alguma outra forma de obter imagens menores em MB? Obrigado. Código da Class usada. Imports WIA Public Class class_cp_Scanner Private ReadOnly _deviceInfo As DeviceInfo Public Sub New(deviceInfo As DeviceInfo) Me._deviceInfo = deviceInfo End Sub Public Function Scan() As ImageFile ' Connect to the device Dim device = Me._deviceInfo.Connect() 'define dialogo para telas de scan (para scan com barra de progresso) Dim dialog = New WIA.CommonDialogClass() ' Start the scan Dim item = device.Items(1) 'scan sem barra de progresso ''''Dim imageFile = DirectCast(item.Transfer(FormatID.wiaFormatJPEG), ImageFile) AdjustScannerSettings(item, 300, 0, 0, 1010, 620, 0, 0) 'scan com barra de progresso Dim imageFile = TryCast(dialog.ShowTransfer(item, WIA.FormatID.wiaFormatJPEG), WIA.ImageFile) ' Return the imageFile Return imageFile End Function Public Overrides Function ToString() As String Return Me._deviceInfo.Properties("Name").Value.ToString ' get_Value().ToString() End Function Public Sub SetWIAProperty(properties As IProperties, propName As Object, propValue As Object) Dim prop As [Property] = properties.get_Item(propName) prop.set_Value(propValue) End Sub Public Sub AdjustScannerSettings(scannnerItem As IItem, scanResolutionDPI As Integer, scanStartLeftPixel As Integer, scanStartTopPixel As Integer, scanWidthPixels As Integer, scanHeightPixels As Integer, _ brightnessPercents As Integer, contrastPercents As Integer) Const WIA_HORIZONTAL_SCAN_RESOLUTION_DPI As String = "6147" Const WIA_VERTICAL_SCAN_RESOLUTION_DPI As String = "6148" Const WIA_HORIZONTAL_SCAN_START_PIXEL As String = "6149" Const WIA_VERTICAL_SCAN_START_PIXEL As String = "6150" Const WIA_HORIZONTAL_SCAN_SIZE_PIXELS As String = "6151" Const WIA_VERTICAL_SCAN_SIZE_PIXELS As String = "6152" Const WIA_SCAN_BRIGHTNESS_PERCENTS As String = "6154" Const WIA_SCAN_CONTRAST_PERCENTS As String = "6155" SetWIAProperty(scannnerItem.Properties, WIA_HORIZONTAL_SCAN_RESOLUTION_DPI, scanResolutionDPI) SetWIAProperty(scannnerItem.Properties, WIA_VERTICAL_SCAN_RESOLUTION_DPI, scanResolutionDPI) SetWIAProperty(scannnerItem.Properties, WIA_HORIZONTAL_SCAN_START_PIXEL, scanStartLeftPixel) SetWIAProperty(scannnerItem.Properties, WIA_VERTICAL_SCAN_START_PIXEL, scanStartTopPixel) SetWIAProperty(scannnerItem.Properties, WIA_HORIZONTAL_SCAN_SIZE_PIXELS, scanWidthPixels) SetWIAProperty(scannnerItem.Properties, WIA_VERTICAL_SCAN_SIZE_PIXELS, scanHeightPixels) SetWIAProperty(scannnerItem.Properties, WIA_SCAN_BRIGHTNESS_PERCENTS, brightnessPercents) SetWIAProperty(scannnerItem.Properties, WIA_SCAN_CONTRAST_PERCENTS, contrastPercents) End Sub End Class [S18] Erro obtido na linha: AdjustScannerSettings(item, 300, 0, 0, 1010, 620, 0, 0) An unhandled exception of type 'System.MissingMemberException' occurred in Microsoft.VisualBasic.dll Additional information: Public member 'get_Item' on type 'PropertiesClass' not found. Referência: http://www.nakov.com/blog/2009/11/17/playing-with-the-scanner-with-wia-and-c/ Usando: VB.NET 2013
×
×
  • Criar Novo...