Newsgroup: it.comp.appl.access
Titolo: CRASH SU IMMAGINI COLLEGATE in MASCHERE E REPORT

Buongiorno a tutto il NG.
ho seguito le varie istruzioni dedicate all'argomento sul Sito Comune e 
ho inserito il controllo (casella di testo) Pathimmagine collegato al 
campo della tabella dove memorizzo il percorso dell'immagine e 
un'immagine non associata, con questo codice
Me.immagine.picture = Me.Pathimmagine (su onCurrent nella maschera e 
onFormat nel report).
Apparentemente funziona tutto, ma in realta'... il crash è in agguato:
Le immagini sono tutte .jpg di dimensione minima (10K cad), i record 
sono circa 380 e uso access 2003.
In pratica il problema è che se passo velocemente da un record 
all'altro, dopo qualche decina di record il caricamento dell'immagine 
si pianta e access da' errore e si chiude. 
Per evitare lo scorrimento rapido ho disabilitato la rotellina del 
mouse sulle due maschere principali e ho fatto la modifica del registro 
per disabilitare l'indicatore di caricamento immagine (anche se mi era 
parso di capire che fosse un problema di a97). 
Il problema si verifica principalmente a livello di report, ma ogni 
tanto anche sulle maschere (da quando ho disabilitato la rotellina, 
almeno sulle maschere andiamo molto meglio).
Pero' non ho altre ispirazioni... è possibile inibire il passaggio ad 
un record successivo/precedente della maschera/report fino a quando 
l'operazione di caricamento del record corrente non sia stata terminata?
Ho googlato un po', ma non ho trovato nulla che facesse al caso mio.
Grazie in anticipo
Erika

 ha scritto nel messaggio 
news:200507201...@mynewsgate.net...

Usa DoEvents.
Ciao, Carlo 


Ciao
Come gestisci la possibilità che la foto non sia raggiungibile?
-- 
_ _
Ciao
MAssimiliano Amendola            
www.accessgroup.it
Cisa - Conferenza Italiana per Sviluppatori Access
Info:  
www.donkarl.com/it

 Erika
-- 
Roberto
-----------------------------------------------------
il Sito Comune di it.comp.appl.access
http://www.sitocomune.com
----------------------------------------------------

Ami ha scritto:

Ciao Erika,
come stai ?
Spero bene.
Mi sono scontrato anche io con questo problema recentemente.
Avevo provato anche io con DoEvents o a cambiare la chiave di registro
come ti hanno consigliato ma senza successo.
Ho però risolto prendendo spunto dal ArchiFoto di @Alex.
Prova in questo modo :
copia questi due moduli nel tuo db :
'================================================
' Module:        mGDIpEx.bas
' Author:        (*)
' Dependencies:  -
' Last revision: 2004.08.02
'================================================
'
' (*) From great stuff:
'
'     +
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=37541&lngWId=1
'       by Avery
'     + Also thanks to Vlad Vissoultchev
'
' GDI+ PNG (Load/Save) and JPEG (Save) support
' High-quality scaling
'
' In case lower versions than Windows XP, needed:
'
'     Platform SDK Redistributable: GDI+ RTM
'     
http://www.microsoft.com/downloads/release.asp?releaseid=32738
Option Explicit
'-- GDI+ API:
Public Enum GpImageFormat
    [ImageGIF] = 0
    [ImageJPEG] = 1
    [ImagePNG] = 2
    [ImageTIFF] = 3
End Enum
Public Enum GpStatus
    [ok] = 0
    [GenericError] = 1
    [InvalidParameter] = 2
    [OutOfMemory] = 3
    [ObjectBusy] = 4
    [InsufficientBuffer] = 5
    [NotImplemented] = 6
    [Win32Error] = 7
    [WrongState] = 8
    [Aborted] = 9
    [FileNotFound] = 10
    [ValueOverflow ] = 11
    [AccessDenied] = 12
    [UnknownImageFormat] = 13
    [FontFamilyNotFound] = 14
    [FontStyleNotFound] = 15
    [NotTrueTypeFont] = 16
    [UnsupportedGdiplusVersion] = 17
    [GdiplusNotInitialized ] = 18
    [PropertyNotFound] = 19
    [PropertyNotSupported] = 20
End Enum
Public Type GdiplusStartupInput
    GdiplusVersion           As Long
    DebugEventCallback       As Long
    SuppressBackgroundThread As Long
    SuppressExternalCodecs   As Long
End Type
'//
Private Enum GpUnit
    [UnitWorld]
    [UnitDisplay]
    [UnitPixel]
    [UnitPoint]
    [UnitInch]
    [UnitDocument]
    [UnitMillimeter]
End Enum
Private Enum QualityMode
    [QualityModeInvalid] = -1
    [QualityModeDefault] = 0
    [QualityModeLow] = 1
    [QualityModeHigh] = 2
End Enum
Private Enum PixelOffsetMode
    [PixelOffsetModeInvalid] = -1
    [PixelOffsetModeDefault]
    [PixelOffsetModeHighSpeed]
    [PixelOffsetModeHighQuality]
    [PixelOffsetModeNone]
    [PixelOffsetModeHalf]
End Enum
Private Enum InterpolationMode
    [InterpolationModeInvalid] = [QualityModeInvalid]
    [InterpolationModeDefault] = [QualityModeDefault]
    [InterpolationModeLowQuality] = [QualityModeLow]
    [InterpolationModeHighQuality] = [QualityModeHigh]
    [InterpolationModeBilinear]
    [InterpolationModeBicubic]
    [InterpolationModeNearestNeighbor]
    [InterpolationModeHighQualityBilinear]
    [InterpolationModeHighQualityBicubic]
End Enum
Private Enum EncoderParameterValueType
    [EncoderParameterValueTypeByte] = 1
    [EncoderParameterValueTypeASCII] = 2
    [EncoderParameterValueTypeShort] = 3
    [EncoderParameterValueTypeLong] = 4
    [EncoderParameterValueTypeRational] = 5
    [EncoderParameterValueTypeLongRange] = 6
    [EncoderParameterValueTypeUndefined] = 7
    [EncoderParameterValueTypeRationalRange] = 8
End Enum
Private Enum EncoderValue
    [EncoderValueColorTypeCMYK] = 0
    [EncoderValueColorTypeYCCK] = 1
    [EncoderValueCompressionLZW] = 2
    [EncoderValueCompressionCCITT3] = 3
    [EncoderValueCompressionCCITT4] = 4
    [EncoderValueCompressionRle] = 5
    [EncoderValueCompressionNone] = 6
    [EncoderValueScanMethodInterlaced]
    [EncoderValueScanMethodNonInterlaced]
    [EncoderValueVersionGif87]
    [EncoderValueVersionGif89]
    [EncoderValueRenderProgressive]
    [EncoderValueRenderNonProgressive]
    [EncoderValueTransformRotate90]
    [EncoderValueTransformRotate180]
    [EncoderValueTransformRotate270]
    [EncoderValueTransformFlipHorizontal]
    [EncoderValueTransformFlipVertical]
    [EncoderValueMultiFrame]
    [EncoderValueLastFrame]
    [EncoderValueFlush]
    [EncoderValueFrameDimensionTime]
    [EncoderValueFrameDimensionResolution]
    [EncoderValueFrameDimensionPage]
End Enum
Private Type CLSID
    Data1         As Long
    Data2         As Integer
    Data3         As Integer
    Data4(0 To 7) As Byte
End Type
Private Type ImageCodecInfo
    ClassID           As CLSID
    FormatID          As CLSID
    CodecName         As Long
    DllName           As Long
    FormatDescription As Long
    FilenameExtension As Long
    MimeType          As Long
    Flags             As Long
    Version           As Long
    SigCount          As Long
    SigSize           As Long
    SigPattern        As Long
    SigMask           As Long
End Type
'-- Encoder Parameter structure
Private Type EncoderParameter
    GUID           As CLSID
    NumberOfValues As Long
    Type           As EncoderParameterValueType
    Value          As Long
End Type
'-- Encoder Parameters structure
Private Type EncoderParameters
    Count     As Long
    Parameter As EncoderParameter
End Type
'-- Encoder parameter sets
Private Const EncoderCompression      As String =
"{E09D739D-CCD4-44EE-8EBA-3FBF8BE4FC58}"
Private Const EncoderColorDepth       As String =
"{66087055-AD66-4C7C-9A18-38A2310B8337}"
Private Const EncoderScanMethod       As String =
"{3A4E2661-3109-4E56-8536-42C156E7DCFA}"
Private Const EncoderVersion          As String =
"{24D18C76-814A-41A4-BF53-1C219CCCF797}"
Private Const EncoderRenderMethod     As String =
"{6D42C53A-229A-4825-8BB7-5C99E2B9A8B8}"
Private Const EncoderQuality          As String =
"{1D5BE4B5-FA4A-452D-9CDD-5DB35105E7EB}"
Private Const EncoderTransformation   As String =
"{8D0EB2D1-A58E-4EA8-AA14-108074B7B6F9}"
Private Const EncoderLuminanceTable   As String =
"{EDB33BCE-0266-4A77-B904-27216099E717}"
Private Const EncoderChrominanceTable As String =
"{F2E455DC-09B3-4316-8260-676ADA32481C}"
Private Const EncoderSaveFlag         As String =
"{292266FC-AC40-47BF-8CFC-A85B89A655DE}"
Private Const CodecIImageBytes        As String =
"{025D1823-6C7D-447B-BBDB-A3CBC3DFA2FC}"
Private Type BITMAPINFOHEADER
    biSize          As Long
    biWidth         As Long
    biHeight        As Long
    biPlanes        As Integer
    biBitCount      As Integer
    biCompression   As Long
    biSizeImage     As Long
    biXPelsPerMeter As Long
    biYPelsPerMeter As Long
    biClrUsed       As Long
    biClrImportant  As Long
End Type
Private Type RGBQUAD
    B As Byte
    G As Byte
    R As Byte
    A As Byte
End Type
Private Type BITMAPINFO
    bmiHeader As BITMAPINFOHEADER
    bmiColors As RGBQUAD
End Type
Private Type PICTDESC
    Size       As Long
    Type       As Long
    hBmpOrIcon As Long
    hPal       As Long
End Type
Public Declare Function GdiplusStartup Lib "gdiplus" (Token As Long,
InputBuf As GdiplusStartupInput, Optional ByVal OutputBuf As Long = 0)
As GpStatus
Public Declare Function GdiplusShutdown Lib "gdiplus" (ByVal Token As
Long) As GpStatus
Private Declare Function GdipGetImageEncodersSize Lib "gdiplus"
(numEncoders As Long, Size As Long) As GpStatus
Private Declare Function GdipGetImageEncoders Lib "gdiplus" (ByVal
numEncoders As Long, ByVal Size As Long, Encoders As Any) As GpStatus
Private Declare Function GdipGetImageDecodersSize Lib "gdiplus"
(numDecoders As Long, Size As Long) As GpStatus
Private Declare Function GdipGetImageDecoders Lib "gdiplus" (ByVal
numDecoders As Long, ByVal Size As Long, Decoders As Any) As GpStatus
Private Declare Function GdipCreateFromHDC Lib "gdiplus" (ByVal hDC As
Long, hGraphics As Long) As GpStatus
Private Declare Function GdipCreateHBITMAPFromBitmap Lib "gdiplus"
(ByVal Bitmap As Long, hBmpReturn As Long, ByVal BackGround As Long) As
GpStatus
Private Declare Function GdipCreateBitmapFromGdiDib Lib "gdiplus"
(gdiBitmapInfo As BITMAPINFO, gdiBitmapData As Any, Bitmap As Long) As
GpStatus
Private Declare Function GdipLoadImageFromFile Lib "gdiplus" (ByVal
Filename As String, hImage As Long) As GpStatus
Private Declare Function GdipSaveImageToFile Lib "gdiplus" (ByVal
hImage As Long, ByVal sFilename As String, clsidEncoder As CLSID,
encoderParams As Any) As GpStatus
Private Declare Function GdipSetPixelOffsetMode Lib "gdiplus" (ByVal
hGraphics As Long, ByVal OffsetMode As PixelOffsetMode) As GpStatus
Private Declare Function GdipSetInterpolationMode Lib "gdiplus" (ByVal
hGraphics As Long, ByVal Interpolation As InterpolationMode) As
GpStatus
Private Declare Function GdipDrawImageRectRect Lib "gdiplus" (ByVal
hGraphics As Long, ByVal hImage As Long, ByVal dstX As Long, ByVal dstY
As Long, ByVal dstWidth As Long, ByVal dstHeight As Long, ByVal srcX As
Long, ByVal srcY As Long, ByVal srcWidth As Long, ByVal srcHeight As
Long, ByVal srcUnit As GpUnit, Optional ByVal imageAttributes As Long =
0, Optional ByVal Callback As Long = 0, Optional ByVal CallbackData As
Long = 0) As GpStatus
Private Declare Function GdipDrawImageRectRectI Lib "gdiplus" (ByVal
hGraphics As Long, ByVal hImage As Long, ByVal dstX As Long, ByVal dstY
As Long, ByVal dstWidth As Long, ByVal dstHeight As Long, ByVal srcX As
Long, ByVal srcY As Long, ByVal srcWidth As Long, ByVal srcHeight As
Long, ByVal srcUnit As GpUnit, Optional ByVal imageAttributes As Long =
0, Optional ByVal Callback As Long = 0, Optional ByVal CallbackData As
Long = 0) As GpStatus
Private Declare Function GdipDisposeImage Lib "gdiplus" (ByVal hImage
As Long) As GpStatus
Private Declare Function GdipDeleteGraphics Lib "gdiplus" (ByVal
hGraphics As Long) As GpStatus
Private Declare Function CLSIDFromString Lib "ole32" (ByVal lpszProgID
As Long, pCLSID As CLSID) As Long
Private Declare Function lstrlenW Lib "kernel32" (ByVal psString As
Any) As Long
Private Declare Function lstrlenA Lib "kernel32" (ByVal psString As
Any) As Long
Private Declare Function OleCreatePictureIndirect Lib "olepro32"
(lpPictDesc As PICTDESC, riid As Any, ByVal fPictureOwnsHandle As Long,
IPic As IPicture) As Long
Private Declare Function CopyMemory Lib "kernel32" Alias
"RtlMoveMemory" (Dest As Any, Src As Any, ByVal cb As Long) As Long
Private Const vbPicTypeNone = 0 'Picture is empty
Private Const vbPicTypeBitmap = 1 'Bitmap (.bmpBMP files)
Private Const vbPicTypeMetafile = 2 'Metafile (.wmfWMF files)
Private Const vbPicTypeIcon = 3 'Icon (.icoICO files)
Private Const vbPicTypeEMetafile = 4 'Enhanced Metafile (.emfEMF files)
'//
Public Function LoadPictureEx(ByVal sFilename As String) As StdPicture
  Dim gplRet        As Long
  Dim hImg          As Long
  Dim hBmp          As Long
  Dim uPictDesc     As PICTDESC
  Dim aGuid(0 To 3) As Long
  Dim varString As Variant
    '-- Load image
    varString = StrConv(sFilename, vbUnicode)
    'gplRet = GdipLoadImageFromFile(StrConv(sFilename, vbUnicode),
hImg)
     Call GdipLoadImageFromFile(varString, hImg)
    '-- Create bitmap
    gplRet = GdipCreateHBITMAPFromBitmap(hImg, hBmp, vbBlack)
    '-- Free image
    gplRet = GdipDisposeImage(hImg)
    If (gplRet = [ok]) Then
        '-- Fill struct
        With uPictDesc
            .Size = Len(uPictDesc)
            .Type = vbPicTypeBitmap
            .hBmpOrIcon = hBmp
            .hPal = 0
        End With
        '-- Fill in magic IPicture GUID
{7BF80980-BF32-101A-8BBB-00AA00300CAB}
        aGuid(0) = &H7BF80980
        aGuid(1) = &H101ABF32
        aGuid(2) = &HAA00BB8B
        aGuid(3) = &HAB0C3000
        '-- Create picture from bitmap handle
        OleCreatePictureIndirect uPictDesc, aGuid(0), -1, LoadPictureEx
    End If
End Function
'Public Function SaveDIB(DIB As cDIB, _
'                        ByVal sFilename As String, _
'                        ByVal lEncoder As GpImageFormat, _
'                        Optional ByVal JPEG_Quality As Long = 90, _
'                        Optional ByVal TIFF_ColorDepth As Long = 24, _
'                        Optional ByVal TIFF_Compression As Long =
[EncoderValueCompressionNone] _
'                        ) As Boolean
'
'  Dim gplRet       As Long
'  Dim uInfo        As BITMAPINFO
'  Dim hImg         As Long
'  Dim uEncCLSID    As CLSID
'  Dim uEncParams   As EncoderParameters
'  Dim aEncParams() As Byte
'
'    '-- Prepare struct
'    With uInfo.bmiHeader
'        .biSize = Len(uInfo.bmiHeader)
'        .biPlanes = 1
'        .biBitCount = 32
'        .biWidth = DIB.Width
'        .biHeight = DIB.Height
'    End With
'
'    '-- Create bitmap
'    gplRet = GdipCreateBitmapFromGdiDib(uInfo, ByVal DIB.lpBits, hImg)
'
'    '-- Get image encoder
'    Select Case lEncoder
'
'        Case [ImageGIF]
'            '-- GIF encoder
'            Call pvGetEncoderClsID("image/gif", uEncCLSID)
'            ReDim aEncParams(1 To Len(uEncParams))
'
'        Case [ImageJPEG]
'            '-- JPEG encoder
'            Call pvGetEncoderClsID("image/jpeg", uEncCLSID)
'            '-- Set encoders params. (Quality)
'            uEncParams.Count = 1: ReDim aEncParams(1 To
Len(uEncParams))
'            With uEncParams.Parameter
'                .NumberOfValues = 1
'                .Type = [EncoderParameterValueTypeLong]
'                .GUID = pvDEFINE_GUID(EncoderQuality)
'                .Value = VarPtr(JPEG_Quality)
'            End With
'            Call CopyMemory(aEncParams(1), uEncParams,
Len(uEncParams))
'
'        Case [ImagePNG]
'            '-- PNG encoder
'            Call pvGetEncoderClsID("image/png", uEncCLSID)
'            ReDim aEncParams(1 To Len(uEncParams))
'
'        Case [ImageTIFF]
'            '-- TIFF encoder
'            Call pvGetEncoderClsID("image/tiff", uEncCLSID)
'            '-- Set encoders params. (Compression/Color depth)
'            uEncParams.Count = 2: ReDim aEncParams(1 To
Len(uEncParams) + Len(uEncParams.Parameter))
'            With uEncParams.Parameter
'                .NumberOfValues = 1
'                .Type = [EncoderParameterValueTypeLong]
'                .GUID = pvDEFINE_GUID(EncoderCompression)
'                .Value = VarPtr(TIFF_Compression)
'            End With
'            Call CopyMemory(aEncParams(1), uEncParams,
Len(uEncParams))
'            With uEncParams.Parameter
'                .NumberOfValues = 1
'                .Type = [EncoderParameterValueTypeLong]
'                .GUID = pvDEFINE_GUID(EncoderColorDepth)
'                .Value = VarPtr(TIFF_ColorDepth)
'            End With
'            Call CopyMemory(aEncParams(Len(uEncParams) + 1),
uEncParams.Parameter, Len(uEncParams.Parameter))
'    End Select
'
'    '-- Kill previous
'    On Error Resume Next
'       Kill sFilename
'    On Error GoTo 0
'
'    '-- Encode
'    gplRet = GdipSaveImageToFile(hImg, StrConv(sFilename, vbUnicode),
uEncCLSID, aEncParams(1))
'
'    '-- Free image
'    gplRet = GdipDisposeImage(hImg)
'
'    '-- Success
'    SaveDIB = (gplRet = [OK])
'End Function
'
'Public Function ScaleDIB(DIB As cDIB, _
'                         ByVal NewWidth As Long, _
'                         ByVal NewHeight As Long, _
'                         Optional ByVal HighQuality As Boolean = False
_
'                         ) As Boolean
'
'  Dim gplRet    As Long
'  Dim sDIB      As New cDIB
'  Dim uInfo     As BITMAPINFO
'  Dim hGraphics As Long
'  Dim hImg      As Long
'
'  Dim OldWidth  As Long
'  Dim OldHeight As Long
'
'    If (DIB.hDIB <> 0) Then
'
'        '-- Buffer DIB
'        If (sDIB.Create(NewWidth, NewHeight)) Then
'
'            '-- Get source dimensions
'            OldWidth = DIB.Width
'            OldHeight = DIB.Height
'
'            '-- Create 'surface'
'            gplRet = GdipCreateFromHDC(sDIB.hDC, hGraphics)
'
'            '-- Create bitmap
'            With uInfo.bmiHeader
'                .biSize = Len(uInfo.bmiHeader)
'                .biPlanes = 1
'                .biBitCount = 32
'                .biWidth = DIB.Width
'                .biHeight = DIB.Height
'            End With
'            gplRet = GdipCreateBitmapFromGdiDib(uInfo, ByVal
DIB.lpBits, hImg)
'
'            '-- Scale
'            If (HighQuality) Then
'                gplRet = GdipSetInterpolationMode(hGraphics,
[InterpolationModeHighQualityBicubic])
'              Else
'                gplRet = GdipSetInterpolationMode(hGraphics,
[InterpolationModeNearestNeighbor])
'            End If
'            gplRet = GdipSetPixelOffsetMode(hGraphics,
[PixelOffsetModeHighQuality])
'            gplRet = GdipDrawImageRectRectI(hGraphics, hImg, 0, 0,
NewWidth, NewHeight, 0, 0, OldWidth, OldHeight, [UnitPixel])
'
'            '-- Clean up
'            gplRet = GdipDisposeImage(hImg)
'            gplRet = GdipDeleteGraphics(hGraphics)
'
'            '-- Success
'            If (gplRet = [OK]) Then
'
'                '-- Get from Buffer
'                If (DIB.Create(NewWidth, NewHeight)) Then
'                    DIB.LoadBlt sDIB.hDC
'                    ScaleDIB = True
'                End If
'            End If
'        End If
'    End If
'End Function
'========================================================================================
' Private
'========================================================================================
Private Function pvGetEncoderClsID(strMimeType As String, ClassID As
CLSID) As Long
  Dim Num      As Long
  Dim Size     As Long
  Dim lIdx     As Long
  Dim ICI()    As ImageCodecInfo
  Dim Buffer() As Byte
    pvGetEncoderClsID = -1 ' Failure flag
    '-- Get the encoder array size
    Call GdipGetImageEncodersSize(Num, Size)
    If (Size = 0) Then Exit Function ' Failed!
    '-- Allocate room for the arrays dynamically
    ReDim ICI(1 To Num) As ImageCodecInfo
    ReDim Buffer(1 To Size) As Byte
    '-- Get the array and string data
    Call GdipGetImageEncoders(Num, Size, Buffer(1))
    '-- Copy the class headers
    Call CopyMemory(ICI(1), Buffer(1), (Len(ICI(1)) * Num))
    '-- Loop through all the codecs
    For lIdx = 1 To Num
        '-- Must convert the pointer into a usable string
        If (StrComp(pvPtrToStrW(ICI(lIdx).MimeType), strMimeType,
vbTextCompare) = 0) Then
            ClassID = ICI(lIdx).ClassID ' Save the Class ID
            pvGetEncoderClsID = lIdx      ' Return the index number for
success
            Exit For
        End If
    Next lIdx
    '-- Free the memory
    Erase ICI
    Erase Buffer
End Function
Private Function pvGetDecoderClsID(strMimeType As String, ClassID As
CLSID) As Long
  Dim Num      As Long
  Dim Size     As Long
  Dim lIdx     As Long
  Dim ICI()    As ImageCodecInfo
  Dim Buffer() As Byte
    pvGetDecoderClsID = -1 'Failure flag
    '-- Get the encoder array size
    Call GdipGetImageDecodersSize(Num, Size)
    If (Size = 0) Then Exit Function ' Failed!
    '-- Allocate room for the arrays dynamically
    ReDim ICI(1 To Num) As ImageCodecInfo
    ReDim Buffer(1 To Size) As Byte
    '-- Get the array and string data
    Call GdipGetImageDecoders(Num, Size, Buffer(1))
    '-- Copy the class headers
    Call CopyMemory(ICI(1), Buffer(1), (Len(ICI(1)) * Num))
    '-- Loop through all the codecs
    For lIdx = 1 To Num
        '-- Must convert the pointer into a usable string
        If (StrComp(pvPtrToStrW(ICI(lIdx).MimeType), strMimeType,
vbTextCompare) = 0) Then
            ClassID = ICI(lIdx).ClassID ' Save the Class ID
            pvGetDecoderClsID = lIdx      ' Return the index number for
success
            Exit For
        End If
    Next lIdx
    '-- Free the memory
    Erase ICI
    Erase Buffer
End Function
Private Function pvDEFINE_GUID(ByVal sGuid As String) As CLSID
'-- Courtesy of: Dana Seaman
'   Helper routine to convert a CLSID(aka GUID) string to a structure
'   Example ImageFormatBMP = {B96B3CAB-0728-11D3-9D7B-0000F81EF32E}
    Call CLSIDFromString(StrPtr(sGuid), pvDEFINE_GUID)
End Function
'-- From 
www.mvps.org/vbnet
'   Dereferences an ANSI or Unicode string pointer
'   and returns a normal VB BSTR
Private Function pvPtrToStrW(ByVal lpsz As Long) As String
  Dim sOut As String
  Dim lLen As Long
    lLen = lstrlenW(lpsz)
    If (lLen > 0) Then
        sOut = StrConv(String$(lLen, vbNullChar), vbUnicode)
        Call CopyMemory(ByVal sOut, ByVal lpsz, lLen * 2)
        pvPtrToStrW = StrConv(sOut, vbFromUnicode)
    End If
End Function
Private Function pvPtrToStrA(ByVal lpsz As Long) As String
  Dim sOut As String
  Dim lLen As Long
    lLen = lstrlenA(lpsz)
    If (lLen > 0) Then
        sOut = String$(lLen, vbNullChar)
        Call CopyMemory(ByVal sOut, ByVal lpsz, lLen)
        pvPtrToStrA = sOut
    End If
End Function
-----------------------------------------------------------
Option Compare Database
Option Explicit
Private Type POINTAPI
    x As Long
    Y As Long
End Type
Public Type RECTL
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
End Type
Private Type SIZEL
    cx As Long
    cy As Long
End Type
Private Declare Sub CopyMem Lib "kernel32" Alias "RtlMoveMemory" _
(Destination As Any, Source As Any, ByVal Length As Long)
'Create our own copy of the metafile, so it doesn't get wiped out by
subsequent clipboard updates.
Declare Function CopyEnhMetaFile Lib "gdi32" Alias "CopyEnhMetaFileA"
(ByVal hemfSrc As Long, ByVal lpszFile As String) As Long
Private Declare Function PlayEnhMetaFile Lib "gdi32" (ByVal hDC As
Long, ByVal hEMF As Long, lpRect As RECTL) As Long
Private Declare Function apiCloseEnhMetaFile Lib "gdi32" _
Alias "CloseEnhMetaFile" (ByVal hDC As Long) As Long
'Private Declare Function apiCreateEnhMetaFile Lib "gdi32" _
'Alias "CreateEnhMetaFileA" (ByVal hDCref As Long, _
'ByVal lpFileName As String, ByVal lpRect As Any, ByVal lpDescription
As String) As Long
'' lprect as RECT changed to as BYVAL as Any to allow for NULL
Private Declare Function apiCreateEnhMetaFileRECT Lib "gdi32" _
Alias "CreateEnhMetaFileA" (ByVal hDCref As Long, _
ByVal lpFileName As String, ByRef lpRect As RECTL, ByVal lpDescription
As String) As Long
Private Declare Function apiDeleteEnhMetaFile Lib "gdi32" _
Alias "DeleteEnhMetaFile" (ByVal hEMF As Long) As Long
Private Declare Function GetEnhMetaFileBits Lib "gdi32" _
(ByVal hEMF As Long, ByVal cbBuffer As Long, lpbBuffer As Byte) As Long
Private Declare Function apiSelectObject Lib "gdi32" _
 Alias "SelectObject" (ByVal hDC As Long, ByVal hObject As Long) As
Long
Private Declare Function apiGetDC Lib "user32" _
  Alias "GetDC" (ByVal hwnd As Long) As Long
Private Declare Function apiReleaseDC Lib "user32" _
  Alias "ReleaseDC" (ByVal hwnd As Long, _
  ByVal hDC As Long) As Long
Private Declare Function apiDeleteObject Lib "gdi32" _
  Alias "DeleteObject" (ByVal hObject As Long) As Long
Private Declare Function GetStockObject Lib "gdi32" (ByVal nIndex As
Long) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA"
_
(ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, lParam As Any) As Long
Private Declare Function SetStretchBltMode Lib "gdi32" (ByVal hDC As
Long, _
ByVal nStretchMode As Long) As Long
Private Declare Function SetMapMode Lib "gdi32" (ByVal hDC As Long,
ByVal nMapMode As Long) As Long
Private Declare Function SetViewportExtEx Lib "gdi32" _
(ByVal hDC As Long, ByVal nX As Long, ByVal nY As Long, lpSize As
SIZEL) As Long
Private Declare Function SetViewportOrgEx Lib "gdi32" _
(ByVal hDC As Long, ByVal nX As Long, ByVal nY As Long, lpPoint As
POINTAPI) As Long
Private Declare Function SetWindowOrgEx Lib "gdi32" _
(ByVal hDC As Long, ByVal nX As Long, ByVal nY As Long, lpPoint As
POINTAPI) As Long
Private Declare Function SetWindowExtEx Lib "gdi32" _
(ByVal hDC As Long, ByVal nX As Long, ByVal nY As Long, lpSize As
SIZEL) As Long
Private Declare Function apiGetDeviceCaps Lib "gdi32" Alias
"GetDeviceCaps" _
(ByVal hDC As Long, ByVal nIndex As Long) As Long
Private Declare Function SetBkMode Lib "gdi32" (ByVal hDC As Long,
ByVal nBkMode As Long) As Long
' CONSTANTS
' StretchBlt() Modes
Private Const BLACKONWHITE = 1
Private Const WHITEONBLACK = 2
Private Const COLORONCOLOR = 3
Private Const HALFTONE = 4
Private Const MAXSTRETCHBLTMODE = 4
' Windows Message -> ScrollBar
Private Const WM_HSCROLL = &H114
Private Const WM_VSCROLL = &H115
' ScrollBar Commands
Private Const SB_LINEUP = 0
Private Const SB_LINELEFT = 0
Private Const SB_LINEDOWN = 1
Private Const SB_LINERIGHT = 1
Private Const SB_PAGEUP = 2
Private Const SB_PAGELEFT = 2
Private Const SB_PAGEDOWN = 3
Private Const SB_PAGERIGHT = 3
Private Const SB_THUMBPOSITION = 4
Private Const SB_THUMBTRACK = 5
Private Const SB_TOP = 6
Private Const SB_LEFT = 6
Private Const SB_BOTTOM = 7
Private Const SB_RIGHT = 7
Private Const SB_ENDSCROLL = 8
'  Ternary raster operations
Private Const SRCCOPY = &HCC0020 ' (DWORD) dest = source
' Predefined Clipboard Formats
Private Const CF_TEXT = 1
Private Const CF_BITMAP = 2
Private Const CF_METAFILEPICT = 3
Private Const CF_SYLK = 4
Private Const CF_DIF = 5
Private Const CF_TIFF = 6
Private Const CF_OEMTEXT = 7
Private Const CF_DIB = 8
Private Const CF_PALETTE = 9
Private Const CF_PENDATA = 10
Private Const CF_RIFF = 11
Private Const CF_WAVE = 12
Private Const CF_UNICODETEXT = 13
Private Const CF_ENHMETAFILE = 14
'  Mapping Modes
Private Const MM_TEXT = 1
Private Const MM_LOMETRIC = 2
Private Const MM_HIMETRIC = 3
Private Const MM_LOENGLISH = 4
Private Const MM_HIENGLISH = 5
Private Const MM_TWIPS = 6
Private Const MM_ISOTROPIC = 7
Private Const MM_ANISOTROPIC = 8
Private Const vbPicTypeNone = 0 'Picture is empty
Private Const vbPicTypeBitmap = 1 'Bitmap (.bmpBMP files)
Private Const vbPicTypeMetafile = 2 'Metafile (.wmfWMF files)
Private Const vbPicTypeIcon = 3 'Icon (.icoICO files)
Private Const vbPicTypeEMetafile = 4 'Enhanced Metafile (.emfEMF files)
' Stock Logical Objects
Private Const WHITE_BRUSH = 0
Private Const LTGRAY_BRUSH = 1
Private Const GRAY_BRUSH = 2
Private Const DKGRAY_BRUSH = 3
Private Const BLACK_BRUSH = 4
Private Const NULL_BRUSH = 5
Private Const HOLLOW_BRUSH = NULL_BRUSH
Private Const WHITE_PEN = 6
Private Const BLACK_PEN = 7
Private Const NULL_PEN = 8
Private Const OEM_FIXED_FONT = 10
Private Const ANSI_FIXED_FONT = 11
Private Const ANSI_VAR_FONT = 12
Private Const SYSTEM_FONT = 13
Private Const DEVICE_DEFAULT_FONT = 14
Private Const DEFAULT_PALETTE = 15
Private Const SYSTEM_FIXED_FONT = 16
Private Const STOCK_LAST = 16
' Background Modes
Private Const TRANSPARENT = 1
Private Const OPAQUE = 2
Private Const BKMODE_LAST = 2
' GetDeviceCaps
Private Const HORZSIZE = 4           '  Horizontal size in millimeters
Private Const VERTSIZE = 6           '  Vertical size in millimeters
Private Const HORZRES = 8            '  Horizontal width in pixels
Private Const VERTRES = 10           '  Vertical width in pixels
Private Const LOGPIXELSY = 90
Private Const LOGPIXELSX = 88
' How many Twips in 1 inch
Private Const TwipsPerInch = 1440
'-- GDI+
Private m_GDIpToken         As Long         ' Needed to close GDI+
'*******************************************
'DEVELOPED AND TESTED UNDER MICROSOFT ACCESS 97, 2K and 2K2
'
'
'Copyright: Lebans Holdings 1999 Ltd.
'           May not be resold in whole or part by itself, or as part of
a collection.
'           Please feel free to use any/all of this code within your
'           own applications, whether private or commercial, without
cost or obligation.
'           Please include the one line Copyright notice if you use
this function in your own code.
'
'Version:  Ver 5.0
'
'Name:      Public Function fLoadPicture(ctl As Access.Image,
'            Optional strfName As String = "", Optional AutoSize As
Boolean = False) As Boolean
'Inputs:
'           ctl -> Access Image control
'           strfName -> Optional name of Image file to load and bypass
File Dialog
'           Autosize -> flag to signify whether to autosize the control
to its contents
'
'Purpose:   Provides functionality to load JPG,GIF,BMP,EMF,WMF,CUR and
ICO
'           files on systems without the Office Graphics Filters
loaded.
'           Originally developed for Systems with Access Runtime only.
'           Supports transparency in Transparent Gifs.
'           Allows you to resize Images on Forms/Reports at runtime
'           with no loss of Image quality.
'
'Author:    Stephen Lebans
'Email:     
Ste...@lebans.com
'Date:      April 12, 2003, 11:12:13 AM
'
'Called by: Anybody that wants to!
'
'How to use:See inline documentation within each function call.
'
'Notes:
'Enjoy
'Stephen Lebans
' ***************************************
' Called by the fLoadPicture function to copy the bits of the
' selected Image from a StdPicture object into our
' memory Enahnced Metafile.
' Changed to use StretchBlt and SetStretchBltMode
Function fStdPicToImageData(hStdPic As Object, ctl As Access.Image, _
Optional FileNamePath As String = "", Optional AutoSize As Boolean =
False) As Boolean
' Changed all references to StdPicture to Object
' I'm going with late binding as this is a  sample database
' and many users may not be comfortable setting references.
' If you need the faster performance you can use Early binding and
declare
' hStdPic as StdPicture.  Requires a Reference to Standard OLE Types.
' This file, OLEPRO32.DLL
' is usually found in your System folder. Goto the Menu
Tools->References
' and set a reference to the above file.
On Error GoTo ERR_SHOWPIC
' Temp Device Context for EMF creation
Dim hDCref As Long
' DC/Window extents
Dim Sz As SIZEL
Dim pt As POINTAPI
Dim rc As RECTL
' Temp var to hold API returns
Dim lngRet As Long
Dim s As String
' handle to EMF
Dim hMetafile As Long
' handle to Metafile DC
Dim hDCMeta As Long
' Array to hold binary copy of Enhanced Metafile
' we will create.
Dim arrayMeta() As Byte
' Vars to calculate resolution
Dim sngConvertX As Single
Dim sngConvertY As Single
Dim ImageWidth As Long
Dim ImageHeight As Long
Dim Xdpi As Single
Dim Ydpi As Single
Dim TwipsPerPixelX As Single
Dim TwipsPerPixelY As Single
Dim sngHORZRES As Single
Dim sngVERTRES As Single
Dim sngHORZSIZE As Single
Dim sngVERTSIZE As Single
' It must be GetDC not CreateCompatibleDC!!!
hDCref = apiGetDC(0)
' Make sure user has selected a valid supported Image type
If hStdPic.Type = 0 Then
 Err.Raise vbObjectError + 523, "fStdPicToImageData.modStdPic", _
    "Sorry...This function can only read Image files." & vbCrLf &
"Please Select a Valid Supported Image File"
End If
' Calculate the current Screen resolution.
' I used to simply use GetDeviceCaps and
' LOGPIXELSY/LOGPIXELSX. Unfortunately this does not yield accurate
results
' with Metafiles.  LOGPIXELSY will return the value of 96dpi or 120dpi
' depending on the current Windows setting for Small Fonts or Large
Fonts.
' Thanks to Feng Yuan's book "Windows Graphics Programming" for
' explaining the correct method to ascertain screen resolution.
' Let's grab the current size and resolution of our Screen DC.
sngHORZRES = apiGetDeviceCaps(hDCref, HORZRES)
sngVERTRES = apiGetDeviceCaps(hDCref, VERTRES)
sngHORZSIZE = apiGetDeviceCaps(hDCref, HORZSIZE)
sngVERTSIZE = apiGetDeviceCaps(hDCref, VERTSIZE)
' Convert millimeters to inches
sngConvertX = (sngHORZSIZE * 0.1) / 2.54
sngConvertY = (sngVERTSIZE * 0.1) / 2.54
' Convert to DPI
sngConvertX = sngHORZRES / sngConvertX
sngConvertY = sngVERTRES / sngConvertY
Xdpi = sngConvertX
Ydpi = sngConvertY
' Convert Image dimensions to Twips and Pixels
' For fun let's not convert pixels to TWIPS since
' we always do it that way. Let's be different and
' convert the StdPicture Height & Width props directly.
' These are in a Map Mode of HiMetric units, expressed in .01 mm units.
' Convert to CM
sngConvertX = hStdPic.Width * 0.001
sngConvertY = hStdPic.Height * 0.001
'Convert to Inches
sngConvertX = sngConvertX / 2.54
sngConvertY = sngConvertY / 2.54
'Convert to TWIPS
sngConvertX = sngConvertX * 1440
sngConvertY = sngConvertY * 1440
' Calculate TwipsPerPixel
TwipsPerPixelX = TwipsPerInch / Xdpi
TwipsPerPixelY = TwipsPerInch / Ydpi
' Convert to pixels
ImageWidth = sngConvertX / TwipsPerPixelX
ImageHeight = sngConvertY / TwipsPerPixelY
' Create our Enhanced Metafile - Memory Based
' Set our bounding rectangle to match that of the StdPicture object
rc.Right = hStdPic.Width
rc.Bottom = hStdPic.Height
' Since this EMF may be copied to disk let's included come creator
info.
s = "Stephen Lebans" & Chr(0) & Chr(0) & "
www.lebans.com
" & Chr(0) &
Chr(0)
hDCMeta = apiCreateEnhMetaFileRECT(hDCref, vbNullString, rc, s)
' Was the EMF creation successful?
If hDCMeta = 0 Then
    Err.Raise vbObjectError + 525, "fStdPicToImageData.modStdPic", _
    "Sorry...cannot Create Enhanced Metafile"
End If
' Setup our Metafile Device Context
' Set our mapping mode
lngRet = SetMapMode(hDCMeta, MM_TEXT) 'ANISOTROPIC) 'TEXT)
' Setup the extents for our DC
lngRet = SetWindowExtEx(hDCMeta, ImageWidth, ImageHeight, Sz)
lngRet = SetWindowOrgEx(hDCMeta, 0&, 0&, pt)
lngRet = SetWindowExtEx(hDCMeta, ImageWidth, ImageHeight, Sz)
' Setup the basics
lngRet = SetBkMode(hDCMeta, TRANSPARENT)
lngRet = apiSelectObject(hDCMeta, GetStockObject(NULL_BRUSH))
lngRet = apiSelectObject(hDCMeta, GetStockObject(NULL_PEN))
' Fixes resizing issue.
lngRet = SetStretchBltMode(hDCMeta, COLORONCOLOR)
' Use the Render method of the StdPicture object.
' Boy the MS docs on this method are not easy to digest.
' I actually found a german web site that explained it in better detail
' with examples. My problem is that I could not find a sample
' of Rendering to a Metafile DC. The MS Docs state that you must supply
' a bounding rectangle as the last argument. No matter how I tried,
' I could not get the method to accept this parameter in any
condiguration.
' Nearly ready to give up, by mistake I set the param to NULL and it
worked.
' Go figure!
' The documentation regarding the Render method is not accurate.
' You do not need to suplly a bounding RECT when rendering
' to a Metafile DC.
hStdPic.Render CLng(hDCMeta), 0&, 0&, CLng(ImageWidth),
CLng(ImageHeight), _
0&, hStdPic.Height, hStdPic.Width, -hStdPic.Height, vbNull
' You just never know...better safe than sorry!<grin>
DoEvents
' I have seen the following call fail on WIndos 98 systems.
' This happens when you have a report with a lot of Images
' and is due to a bug in the GDI with respect to Metafiles.
' Full details are on my web site in the Image handling FAQ.
hMetafile = apiCloseEnhMetaFile(hDCMeta)
If hMetafile = 0 Then
    fStdPicToImageData = False
    Exit Function
End If
' Grab the contents of the Metafile
lngRet = GetEnhMetaFileBits(hMetafile, 0, ByVal 0&)
If lngRet = 0 Then
    fStdPicToImageData = False
    Exit Function
End If
ReDim arrayMeta((lngRet - 1) + 8)
lngRet = GetEnhMetaFileBits(hMetafile, lngRet, arrayMeta(8))
' Delete EMF memory footprint.
lngRet = apiDeleteEnhMetaFile(hMetafile)
' If the first 40 bytes of a PictureData prop are
' not a BITMAPINFOHEADER structure then we will find
' a ClipBoard Format structure of 8 Bytes in length
' signifying whether a Metafile or Enhanced Metafile is present.
' The first 8 Bytes of a PictureData prop signify
' that the data is structured as one of the
' following ClipBoard Formats.
' CF_ENHMETAFILE
' CF_METAFILEPICT
' So the first 4 bytes tell us the format of the data.
' The next 4 bytes point to handle for a Memory Metafile.
' This is not needed for our construction purposes.
arrayMeta(0) = CF_ENHMETAFILE
' Copy our created PictureData bytes over to the Image Contol.
ctl.PictureData = arrayMeta
' Do we auto size the Image control to the
' dimensions of its the loaded image?
If AutoSize Then
    ' Error check to ensure we do not exceed
    ' SubForm boundaries
    If sngConvertX < ctl.Parent.Width Then
     '  If sngConvertX < Section(ctl.Section).Width Then
       ctl.Width = sngConvertX '+ 15
    Else
        ctl.Width = ctl.Parent.Width - 200
    End If
    If sngConvertY < ctl.Parent.Detail.Height Then
        ctl.Height = sngConvertY '+ 15
    Else
        ctl.Height = ctl.Parent.Detail.Height - 200
    End If
     ctl.SizeMode = acOLESizeStretch
End If
EXIT_SHOWPIC:
' Release our reference DC
lngRet = apiReleaseDC(0&, hDCref)
Exit Function
ERR_SHOWPIC:
MsgBox Err.Description, vbOKOnly, Err.Source & ":" & Err.Number
Resume EXIT_SHOWPIC
End Function
Public Function fLoadPicture(ctl As Access.Image, strfName As String,
Optional AutoSize As Boolean = False) As Boolean
' Inputs
' ctl -> Access Image control
' strfName -> Optional name of Image file to load and bypass File
Dialog
On Error GoTo Err_fLoadPicture
' Temp Vars
Dim lngRet As Long
Dim blRet As Boolean
' Our StdPicture object returned by LoadPicture
Dim hPic As Object
' Were we passed the Optional FileName and Path
' It may take a few seconds to render larger JPEGs.
' Set the MousePointer to "HOURGLASS"
Application.Screen.MousePointer = 11
' Load the Picture as a StandardPicture object
'Set hPic = LoadPicture(strfName)
'********************  START PARTE DI GESTIONE PNG
************************
Select Case Right$(strfName, 3)
    Case "bmp", "dib", "Gif", "emf", "Wmf", "ico", "cur", "jpg", "peg"
    ' Load the Picture as a StandardPicture object
    ' Use VBA LoadPicture function
    Set hPic = LoadPicture(strfName)
    Case "tif", "png"
    Dim GpInput As GdiplusStartupInput
    '-- Load the GDI+ Dll
    GpInput.GdiplusVersion = 1
    If (mGDIpEx.GdiplusStartup(m_GDIpToken, GpInput) <> [ok]) Then
      Call MsgBox("Error loading GDI+!", vbCritical)
      'Call Unload(Me)
      Exit Function
    End If
    ' Load the Picture as a StandardPicture object
    ' Use GDI+
    Set hPic = LoadPictureEx(strfName)
    ' Unload the GDI+ Dll
    Call mGDIpEx.GdiplusShutdown(m_GDIpToken)
    Case Else
    ' Unsupported Format
    ' Raise the exception
    Err.Raise vbObjectError + 518, "LoadJpegGif.modStdPic", _
    "This Image format is not supported!" & vbCrLf & strfName & vbCrLf
& _
    "Please Select a Supported Image format:" & vbCrLf & _
    "JPEG, TIFF, PNG, BMP, DIB, GIF, EMF, WMF, ICO or CUR"
End Select
'********************  STOP PARTE DI GESTIONE PNG
************************
If hPic = 0 Then
    Err.Raise vbObjectError + 514, "LoadJpegGif.modStdPic", _
    "Please Select a Supported Image format:" & vbCrLf & _
    "JPEG, TIFF, PNG, BMP, DIB, GIF, EMF, WMF, ICO or CUR"
End If
' Call our function to convert the StdPicture object
' into a DIB wrapped within an Enhanced Metafile
blRet = fStdPicToImageData(hPic, ctl, , AutoSize)
' need error handling here
' Cleanup
fLoadPicture = True
Exit_LoadPic:
' Set the MousePointer back to Default
Application.Echo True
Application.Screen.MousePointer = 0
Err.Clear
Set hPic = Nothing
Exit Function
Err_fLoadPicture:
fLoadPicture = False
Application.Screen.MousePointer = 0
MsgBox Err.Description, vbOKOnly, Err.Source & ":" & Err.Number
Resume Exit_LoadPic
End Function
Public Sub ScrollToHome(ctl As Control)
' Scroll the Form back to X:0,Y:0
' The Form is heavily Subclassed by Access.
' It does not seem to respond to SB_TOP or SB_LEFT
' so we have to resort to the following kludge.
' Temp var
Dim lngRet As Long
' Temp counter
Dim lngTemp As Long
' Be careful because of Echo Off
On Error Resume Next
' Stop Screen Redraws
Application.Echo False
For lngTemp = 1 To 9
lngRet = SendMessage(ctl.Parent.hwnd, WM_VSCROLL, SB_PAGEUP, 0&)
lngRet = SendMessage(ctl.Parent.hwnd, WM_HSCROLL, SB_PAGELEFT, 0&)
Next lngTemp
' Start Screen Redraws
Application.Echo True
End Sub
------------------------------------------------------------------
la richiami così :
Call fLoadPicture(Me.ControlloImmagine, Me.nomeImmagineEPath)
magari ci saranno altre soluzione, ma non ne ho trovate.
Se hai problemi in serata ti rimando questa soluzione nel tuo Db che
tanto da qualche parte a casa lo devo avere.
Intanto ti saluto.
Sandro
Ps. Spero che il post sia ben leggibile, sto scrivendo da Internet.

 Apparentemente funziona tutto, ma in realta'... il crash è in agguato:
Beata te!
ma io non capisco. 
"MA" in una risposta ad un problema similie mi ha detto di aggiungere 
un'immagine non associata (quella con il sole e le montagne). Ma se la 
inserisco lui subito mi chiede di associarla ad un'immagine statica. Non 
capisco il nesso fra inserire l'immagine statica e mettere la riga di 
codice tanto famosa. Per scrivere quella riga di codice io clicco in un 
punto vuote del corpo del report e con il pulsante destro apro il menu a 
tendina, clicco su genera evento, e qui scrivo la riga come la tua fra 
"Private Sub Corpo_Format(Cancel As Integer, FormatCount As Integer)" e 
"end sub"
ma non funziona per niente!!!!
[cut]
ciao
-- 
oierpa
"Don' t follow me, I'm lost too!"


Quell'immagine statica ti serve solo per avere il controllo immagine, dopo
la devi eliminare


 ha scritto nel messaggio 
news:200507201...@mynewsgate.net...

..."dopo la devi eliminare", l'immagine, la foto, la bmp, NON il 
controllo...
Ciao, Carlo

 
ti conviene agire sul registro di configurazione di windows...
vai su START, su ESEGUI, scrivi REGEDIT e dai invio..
ti posizioni sulla voce Risorse del computer e clicchi su MODIFICA/TROVA
selezioni le caselle CHIAVI e STRINGA INTERA deselezionando le atre e
trovi la voce JPEG..
ogni voce trovata avrà una sottochiave OPTIONS che devi selezionare...
sulla destra apparirà una voce nominata SHOWPROGRESSDIALOG con valore YES
che devi passare a NO...
ripeti la ricerca premendo F3 e ripeti l'operazione finchè ti viene
riferito che non vi sono altre voci...
la procedura è valida di sicuro sui sistemi da Win 2000 in su, sui
precedenti nn so...

 Ciao, Carlo
zitti zitti che qualcosa si è mosso, ora mi dice che non riesce a trovare 
l'immagine ma è un messaggio incoraggiante. Il file deve essere per forza 
bmp?
Il percorso deve essere assoluto?
Ho messo il percorso come relativo:
.\immagini\nomefile.jpg
e non riusciva a caricare
ora faccio un po' di prove...
sto impazzendo!


 precedenti nn so...
Ha funzionato!
non riuscivo a fare nulla, poi non trovava l'immagine, ho dato il 
percorso assoluto ed è andato a posto, ma quando non c'erano immagini si 
piantava, allora ne ho aggiunte di vuote e ha generato il report.
E' da lunedì mattina che cerco di fare SOLO questo!
Mi hai tolto un peso enorme, non so come ringraziarti!
ciao


 ciao
fai cosě
if dir(tuopercorso) <>"" then
    tuoimmagine.picture = tuopath
else
    tuoimmagine.picture = empty
end if


 ha scritto nel
messaggio news:AosDe.8077$B6.2...@twister1.libero.it...

Io avevo lo stesso problema ed ho risolto così infatti.
SunRex


Ps. Spero che il post sia ben leggibile, sto scrivendo da Internet.
Tutto chiarissimo!
-- 
Per rispondermi... Togli "nospam"
To send me an email... take out "nospam"

[CUT]
Sembra che funzioni!! Vedo le immagini. Devo ancora capire un paio di cose,
ma... per ora tutto OK
Grazie!!
Erika


ma... per ora tutto OK
Rieccomi!
Confermo quanto precedentemente affermato :)
Funziona benissimo.
Unico particolare: se lascio le immagini come jpg, quando carico il report
completo (tutti i 380 record) e scorro da un record all'altro, ho l'errore
"memoria insuff.", se invece uso i bmp, il report diventa molto lento, ma nessun
errore.
Immagino che sia un problema di gestione delle immagini da parte di access,
quando deve gestirne 380 al volo.
Lasciare il bmp non mi crea particolari problemi, certo che la cartella che
contiene le immagini diviene molto pesante, per quanto piccola possa essere la
foto (90x90, circa 25K a foto)
Suggerimenti?
E' anche vero che non penso che mi capitera' mai di stampare TUTTI i record per
fare un'enciclopedia...
Ciao!


 
ok ora provo.
Grazie comunque anche a te, scusa ma ieri ero di fretta e dopo la prova 
sono dovuto schizzare via.
Grazie 1000!
