How do I copy picturedata from one image to another? - vba

I have two image controls. I want to set one of the image controls to hold the same image as the other one. I need to do this in runtime, using VBA.
Me("Option" & RST![ItemNumber]).PictureData = Me("img" & intImage).PictureData
For some reason this line of code doesn't do the trick. It does not give errors, but instead leaves the picture control blank. Any help would be much appreciated.

If you use Microsoft Access 2010 or newer, you can add the image to Access Image Gallery.
Once added to the gallery you can rename it there if you want.
This name you then can use to paste it to the Picture property of the image control to assign it to.
One advantage is that you can reference those images to many image controls, but they only use memory once for storage in the database.
The other advantage is, that you can assign them like this (without having the original file on the disk):
Image1.Picture = Image2.Picture

Related

word-vba: Unable to update linked image link

I have a document with two inlineshapes into a table on the document header. These inlineshapes are linked images. The folder containing these images has moved and I'm unable to change the image link by VBA code.
I'm working with Word 2016. The documents were created on Word 2003. The only way to access the images has been exploring the table cells and finding the inlineshapes into them
The inlineshapes have no field object defined (nothing)
I can update the link manually going into the File menu > Edit File Links...
I would like to be able to change the image links with vba and not having to do it manually
Well, at last I found what happened.
The images have to be accessed as inlineshapes, not as fields
the path to the image is stored in the property InlineShape.LinkFormat.SourceFullName
Changing this property value and then updating the inlineshape it worked
Sorry if I've bothered you but I think it can be helpful to other users

Convert an embedded Excel Picture into an Object

I created a logo in Publisher.
Using TechSmith Snagit, I captured the image and saved as a JPEG.
I fetched the image inside of Excel and placed it in a properly sized cell(s)
I don't want to have a file that has the image (have seen in researching some solutions) -- Nevertheless, everything must be self-contained in my Excel vba Application.
Excel (2013) has a tendency to either erase the image or it creeps when the app is opened on other displays. (And it does this with ActiveX Controls, too)
So... a friend wrote code that stretches or centers ActiveX Controls inside cells. Works brilliantly, except I want to apply the code to the Picture (say Picture 12) ... the Logo ...
If I could convert the Picture into an Object (similar to a CommandButton or a SpinButton, I think the code would work.
My work around had been to insert the logo as a BitMap into a CommandButton, and then apply the stretching code to the button... BUT I have image size limitations and the Bitmap is of low resolution, which makes my beautiful logo look terrible.
Any suggestions would be very much appreciated.
maybe use base64
Inserting an Image into a sheet using Base64 in VBA?
https://www.base64-image.de/

external image in RDLC report

I'm trying to use an external image on a report in my application. It's a windows application form.
The property EnableExternalImages of localreport is True
The source of image is External
As value i'm trying this. file:///C:\image.png
I can see the image on the report from visual studio designer, but when I run my application I can't see the image on the report but only a red X.
What can I do?
UPDATE
I tried the same on a different computer and it works good. So the problem is with my laptop. Any idea?
I had a similar problem and spent two solid days finding a solution. In my case, I was using Dataset objects to populate the data on the report. So, before I refreshed the report, I saved the image into an array of bytes, then on the report set the image source to "Database", selected the corresponding Dataset object, then chose the column that contained the array of bytes. The images appeared in the report when viewing it in both a ReportViewer object and as a PDF file.
maybe its a permission problem? try from your laptop, put the image in a different location where permission is not needed like in documents folder and see if issue still the same.

How to link an image to the header

I have an Excel sheet where I am using an image in the header. From this question I already know how to add or link images as Shapes in an Excel sheet.
Now I need to do something similar to the header, where I can link an Image to the header instead of saving the image in the Workbook (because I have a lot of images which makes the file size huge).
Code:
Sheet.PageSetup.LeftHeaderPicture.Filename
You need to set the Filename property of the _____HeaderPicture property to the path of the picture you want to use.

Placing a bitmap into a Powerpoint Add-In

All:
I am writing a PowerPoint add-in that will allow a user to drop specific safety related images onto a map. I've written the code that copies the images and places them on the slide and I would like to place it into an add-in. Unfortunately, I cannot find a way to either:
a) place the images into the add-in
b) reference images if I were able to place them in the add-in
The alternative approach is to require the user to start with a special template that includes all of the images and then load the add-in to get the menu functionality. I would much rather have a single file that contains both the code and bitmap images.
With best regards,
Walt
PPA files contain only code, not presentation content like images. As an alternative, you could distribute a PPT/PPTX that you open invisibly and extract the image you need.
After quite a bit of looking around I found a solution that resolves the problem adequately. Using Microsoft's Custom UI Editor, I created an XML entry in the PowerPoint Presentation that performs the Auto_Open function that would have been part of the Add-In. This allows me to add the menu functions that will be responsible for loading the specific images.
I've added a reference page at the beginning of the presentation that contains instructions on how to use the template... This page also contains all of the images that are used by the visual basic code. The 'Visible' flag on these images are set to False so the user does not see them. As they are copied from the reference page into the presentation, the Visible flag is set to True and they are pasted onto the current slide.
It is not a perfect solution, but it is adequate...