Image control showing slightly blurry image (1 Viewer)

Isaac

Lifelong Learner
Local time
Today, 05:02
Joined
Mar 14, 2017
Messages
5,792
So I have a form with a Listbox where, when an item in the Listbox is selected, depending on what type of item it is, a certain picture is loaded. The picture is being loaded by code like this:

Code:
'************************************************************************** (start)
'put picture in its place
strPicturePath = CreateObject("wscript.shell").ExpandEnvironmentStrings("%APPDATA%") & "\" & "Picture_" & Format(Now, "mmddyyhhmmss") & ".jpg"
If Dir(strPicturePath) <> "" Then Kill strPicturePath
Set rsPictures = CurrentDb.OpenRecordset("select attachments from tblpictures where picturedescription='" & strPictureDescription & "'") 'returns only 1 record
Set rsAttachments = rsPictures.Fields("Attachments").Value
Do Until rsAttachments.EOF = True
    rsAttachments.Fields("FileData").SaveToFile strPicturePath
    rsAttachments.MoveNext
Loop
Me.imgProgress.Picture = strPicturePath
Me.imgProgress.SizeMode = acOLESizeClip
rsAttachments.Close
rsPictures.Close
Set rsAttachments = Nothing
Set rsPictures = Nothing
'************************************************************************** (finish)

When I this process runs successfully, the picture looks just slightly - but significantly - less CLEAR than it does in real life. It seems to me with CLIP mode, it ought to retain pretty much all of its clarity. The actual picture is very crisp and clear if I just open it from my Windows file system.

Is there any trick I can do to get rid of this "slightly blurry" effect?

ACTUAL PICTURE OPENED FROM FILE SYSTEM:
1617728657666.png


THE WAY IT LOOKS ON MY FORM:

1617728724916.png


Looking at my post preview, I can see it's a very, very slight difference - you can see if it you really try, hopefully. (Check out the red boxes difference). Can I do anything about this?

I'm currently using a regular Image control.

Final PS: Yes I'm storing images in the database but that's because people across multiple LAN's/networks across the globe will be using this and our only commonality is having Access client installed, and Sharepoint. So, I'm storing these (8) different JPG's in a local Access table, Attachments field.
 

Isaac

Lifelong Learner
Local time
Today, 05:02
Joined
Mar 14, 2017
Messages
5,792
Try .Bmp's.
That worked better and seems to have taken away the blurriness. I should have remembered Access likes bmps. Thanks @moke123 !!
 

isladogs

CID VIP
Local time
Today, 13:02
Joined
Jan 14, 2017
Messages
15,412
Or use PNG which gives as good quality as BMP but with significantly smaller file sizes.
In fact you can use almost any image format other than JPG for good results.
 

Isaac

Lifelong Learner
Local time
Today, 05:02
Joined
Mar 14, 2017
Messages
5,792
To be honest with you, gentlemen, after a while the images started showing up just a "little" blurry again, even after I changed it to BMP. It seemed to improve the first time I did it, and then sort of go back to less than ideal. I couldn't figure out any explanation for the difference.

I even thought of uploading them to a Sharepoint doc library, and using the 'hot link' (direct link), but, found out that even in my browser..whenever I viewed "View Original" (which brought up the hotlinked url.bmp file), the quality would actually decrease, compared to when I viewed it normally.

Frustrated again in that way, I decided to throw up my hands and re-create this particular visual with actual labels (etc), changing their backcolor and forecolor as appropriate.

However, this was still a productive conversation for me, as I'll remember not to try using JPGs in the future. Thanks.
 

Users who are viewing this thread

Top Bottom