473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Image Control SizeToFit

Hey,

Sorry about all the image posts its just that i need to get this to
work!!!

- I've already posted about the CanShrink and CanGrow option for image
controls. This is a no go! What if i create another field, in the table
with the images, which has the
dimensions of each image, is there any code i can write in the report
to change the size of the image, control for each image, based on the
dimensions of the
image?

- I just discovered the SizeToFit option for some control and i believe
it should work for images. You can only use it in design view of the
report but i can't seem to find it for the image control. Can anyone
help me!

Thanks again!!!

Christina

Jun 21 '06 #1
4 5709
bob


You can scale an image control in the report’s “Detail_Format” event by setting the controls’ .Width and
.Height properties according to the image dimensions (you’ll need to work out a suitable scaling factor).
You can also set the height of the detail section, for example:

Me.Section(acDetail).Height = 1234

Note that the Detail section can’t be shrunk smaller than the size needed to fully contain any controls
on it, so shrink/move the controls first.

--
__________________________________________________ _____
DBPix 2.0: Add pictures to Access, Easily & Efficiently
http://www.ammara.com/dbpix/access.html


ch*******@hotmail.com wrote:
Hey,

Sorry about all the image posts its just that i need to get this to
work!!!

- I've already posted about the CanShrink and CanGrow option for image
controls. This is a no go! What if i create another field, in the table
with the images, which has the
dimensions of each image, is there any code i can write in the report
to change the size of the image, control for each image, based on the
dimensions of the
image?

- I just discovered the SizeToFit option for some control and i believe
it should work for images. You can only use it in design view of the
report but i can't seem to find it for the image control. Can anyone
help me!

Thanks again!!!

Christina


Jun 21 '06 #2
Hey,

bob wrote:
You can scale an image control in the report's "Detail_Format" event by setting the controls' .Width and
.Height properties according to the image dimensions (you'll need to work out a suitable scaling factor).


How do you set the image controls width and height properties? I have
the values for the height a width the table with the image.

Thanks,

Christina

Jun 22 '06 #3
bob

How do you set the image controls width and height properties? I have
the values for the height a width the table with the image.
Image1.Width = somevalue
Image1.Height = someothervalue

Where Image1 is the name of your image control.

Here’s a full example.

You’ll need to work out the value of ImgScale according to the largest image size you need to handle.

FixedHeight is the height of the detail section if there is no image

Image1 is the image control.

ImgWidth is the field containing the image width (in pixels).
ImgHeight is the field containing the image height (in pixels).

ImgWidth and ImgHeight must be included on the report, otherwise the data values are not available. The
text boxes can be hidden though.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

Const ImgScale As Integer = 5
Const FixedHeight As Integer = 100

If IsNull(Me!ImgWidth) Then
Image1.Width = 0
Else
Image1.Width = Me!ImgWidth * ImgScale
End If

If IsNull(Me!ImgHeight) Then
Image1.Height = 0
Me.Section(acDetail).Height = FixedHeight
Else
Image1.Height = Me!ImgHeight * ImgScale
Me.Section(acDetail).Height = Me!ImgHeight * ImgScale + FixedHeight
End If

End Sub
--
__________________________________________________ _____
DBPix 2.0: Add pictures to Access, Easily & Efficiently
http://www.ammara.com/dbpix/access.html


ch*******@hotmail.com wrote:Hey,

bob wrote:
You can scale an image control in the report's "Detail_Format" event by setting the controls' .Width and .Height properties according to the image dimensions (you'll need to work out a suitable scaling factor).


How do you set the image controls width and height properties? I have
the values for the height a width the table with the image.

Thanks,

Christina


Jun 22 '06 #4
Thank you so much! I really appreciate your help.

cheers,

Christina

Jun 23 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Greg Christie | last post by:
I think I have a somewhat unique situation here, so I thought I should post it for the few poor souls who run across it and try to google it like I did. First of all, I was getting the following...
4
by: Ed Landau | last post by:
In VB6.0, I can put an image on a form and assign it's .picture property at run-time. In VBA (within MS Access), when I put down an image control on a form, it asks me for the source to the image...
4
by: Kevin Myers | last post by:
Hello, Please forgive my reposting of this note with hopefully a more relevant subject line. On an Access 2000 form under Windows 2000 I would like to use a Kodak Image Edit Control to...
12
by: Sharon | last post by:
I’m wrote a small DLL that used the FreeImage.DLL (that can be found at http://www.codeproject.com/bitmap/graphicsuite.asp). I also wrote a small console application in C++ (unmanaged) that uses...
0
by: Satish Appasani | last post by:
Hi: I have a ASP.NET form with Web layout which I've achieved using panels. In one of the tab I have a File control to upload Images. When I put a file in the file control and move to another...
10
by: David W. Simmonds | last post by:
I have a DataList control that has an Image control in the ItemTemplate. I would like to resize the image that goes into that control. I have a series of jpg files that are full size, full...
1
by: Brian | last post by:
Using A2K I have an image control on a report and use code to set the image.picture to the required jpg. 3 of the jpgs resize properly but 2 do not - they display much smaller than the image...
2
by: (PeteCresswell) | last post by:
I've got a form that has a TreeView in the upper part of the form and a TabControl in the lower. When processing a Resize event, the TabControl does not need tb resized - just moved so that the...
0
by: SayamiSuchi | last post by:
hi I have taken one image control("image1") in the form("frmForm1.aspx").Now i want to one image ("mypic.jpeg") whose size is larger than the image control i.e image1.When i run the program, the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.