Visualizzazione dei risultati da 1 a 4 su 4
  1. #1

    VB6 - Errore PictureBox

    Ricevo questo messaggio di errore quando tento di effettuare una stampa da una form VB di tutti i suoi dati e quindi anche del logo in essa presente:

    Metodo 'Picture' dell'oggetto '_PictureBox' non riuscito
    Cosa può essere?

    Grazie anticipatamente!
    Provare paura per un qualcosa che ti possa capitare nel futuro non ti evita quell'evento,ti fa soltanto vivere un presente sbagliato!

  2. #2
    A titolo informativo la routine incriminata è questa, in particolare la parte in grassetto:

    codice:
    Public Sub PaintPicture(image As Variant, Optional cellX As Integer = 0, _
        Optional cellY As Integer = 0, Optional cellWidth As Integer = 1, _
        Optional cellHeight As Integer = 1, Optional imageWidth As Single = 0, _
        Optional imageHeight As Single = 0)
        
        Dim i As Integer
        Dim totWidth As Single
        Dim totHeight As Single
        Dim pictureWidth As Single
        Dim pictureHeight As Single
        
        
        pictureWidth = Printer.ScaleX(image.Width, 8, P_scaleMode)
        pictureHeight = Printer.ScaleY(image.Height, 8, P_scaleMode)
    
        For i = 0 To cellWidth - 1
            totWidth = totWidth + P_colWidth(cellX + i) + P_drawWidth
        Next
        totWidth = totWidth - P_drawWidth - 2 * P_internalBorder
    
        For i = 0 To cellHeight - 1
            totHeight = totHeight + P_rowHeight(cellY + i) + P_drawWidth
        Next
        totHeight = totHeight - P_drawWidth - 2 * P_internalBorder
        
        If imageWidth = 0 And imageHeight = 0 Then
            If pictureHeight <> totHeight Then
                pictureWidth = (pictureWidth * totHeight) / pictureHeight
                pictureHeight = totHeight
            End If
        
            If pictureWidth > totWidth Then
                pictureHeight = (pictureHeight * totWidth) / pictureWidth
                pictureWidth = totWidth
            End If
        Else
            pictureWidth = imageWidth
            pictureHeight = imageHeight
        End If
    
        Call Printer.PaintPicture(image.Picture, _
            P_colPos(cellX) + P_drawWidth + P_internalBorder + (totWidth - pictureWidth) / 2, _
            P_rowPos(cellY) + P_drawWidth + P_internalBorder + (totHeight - pictureHeight) / 2, _
            pictureWidth, _
            pictureHeight) 
    End Sub
    Provare paura per un qualcosa che ti possa capitare nel futuro non ti evita quell'evento,ti fa soltanto vivere un presente sbagliato!

  3. #3
    Nessuno mi sa aiutare? :rollo:
    Provare paura per un qualcosa che ti possa capitare nel futuro non ti evita quell'evento,ti fa soltanto vivere un presente sbagliato!

  4. #4
    Utente di HTML.it L'avatar di Jupy64
    Registrato dal
    Sep 2004
    Messaggi
    1,151
    Ciao, non mi sembra di vedere niente di sbagliato, probabilmente l'errore sta nelle funzioni che richiami e che passi a
    Printer.PaintPicture e comunque sia, ti consiglio di cambiare nome alla funzione pubblica PaintPicture in quanto protrebbe crearti problemi..visto che è anche una proprietà del form...
    Jupy

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.