Embedding images at runtime

  • Thread starter Thread starter Jim Stierle
  • Start date Start date
J

Jim Stierle

I am embedding images at runtime in a report. After
advancing through several pages I run out of memory and
the report cannot load the images for the page.

I am using the OnFormat Event and I am substituting an
image object with an image from a filename.

any suggestion ?

Thanks,
Jim
 
Unless you need to resize the Image control containing the images then:

1) Use the Print Event not the Format event

2) Convert the Images to Bitmap format prior to loading them into the
Image control.
Here's some sample code:(requires setting a Reference to
"OLEAutomation". The file is "/Windows/System/StdOle2.tlb"


Private Function CreateBitmapFile(fname As String) As String

Dim obj As Object

Set obj = LoadPicture(fname)
If Not IsNull(obj) Then

SavePicture obj, "C:\SL11-52"
DoEvents
End If


CreateBitmapFile = "C:\SL11-52"
Set obj = Nothing

End Function

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Stephan,

I have implemented the code below and I getting runtime
errors with the LoadPicture Method.

Is there anything more I can do ?

Thanks,
Jim
 
Back
Top