I have a Powerpoint presentation with a VBA script to update the images every week. Recently, I added 2 additional slides and scripting to update those images as well.
The new images do not update and do not throw an error. If I step through the procedure, it goes to the correct slide, selects the correct shape, but the
Call ppShp.Fill.UserPicture ("blah_blah.png")
does not replace the image.
If I copy the line to one of the slides where it does work, it does.
In the example below, the first one works, the second doesn't.
'FEOL *******************************************************************
ActiveWindow.View.GotoSlide (15)
Set ppShp = ActivePresentation.Slides(15).Shapes("FEOL")
ppShp.Select
Call ppShp.Fill.UserPicture("D:\MIT Trends\Images\Feol_Composite.png")
'LICONSEM *******************************************************************
ActiveWindow.View.GotoSlide (16)
Set ppShp = ActivePresentation.Slides(16).Shapes("LICONSEM")
ppShp.Select
Call ppShp.Fill.UserPicture("D:\MIT Trends\Images\LICONSEM.png")
Again, I can see it go to the correct slide and select the correct shape (named in the "arrange" panel). It just doesn't fill. I tried changing to shape ID, but the results are the same. I know the shape name and image name are correct. I even tried cut/paste to be sure.
Using the image for the first section to fill in the second does not work. Using the image from the second section to fill in the first does. I feel like I must be missing something obvious.
Please find my code in attached image.
First u need to create shape in PPT and then run code.
Related
I'm trying to write a script for Gimp that will crop an image, make a circular selection of what's left, invert the selection, and then delete the selection. I have the cropping, selection, and inversion part done, but the deleting is what's getting me.
(removed old code, see update)
That's the code I have. What's confusing me about the gimp-item-delete code is the item. I understand that I need to define my current selection as the item, but I'm not sure how to do this. If someone could explain how to do this, I would greatly appreciate it! Alternatively, if there's an easier way to do what I'm trying to do (but preferably still in a script), please let me know what you think. My knowledge of this coding is pretty limited, so simple explanations are appreciated.
UPDATE/EDIT:
Here's the (full) updated code:
; XML2 Conversation Portrait Preview Crop
(define (script-fu-xml2-convo-preview image layer)
(gimp-image-undo-group-start image)
(gimp-selection-none image)
(gimp-image-resize image 152 152 -280 -496)
(gimp-layer-resize-to-image-size layer)
(gimp-image-select-ellipse image 0 0 0 152 152)
(gimp-selection-invert image)
(gimp-displays-flush)
(gimp-drawable-edit-clear layer)
(gimp-selection-none image)
(gimp-image-undo-group-end image)
)
; populate script registration information
(script-fu-register
"script-fu-xml2-convo-preview"
"XML2 Conversation Portrait Preview Crop"
"Crops the preview window for XML2 conversation portraits."
"BaconWizard17"
"BaconWizard17"
"September 2021"
"*"
SF-IMAGE "Image" 0
SF-DRAWABLE "Layer" 0
)
; register the script within gimp menu
(script-fu-menu-register "script-fu-xml2-convo-preview" "<Image>/Marvel Mods/Skin Previews/XML2 PC")
So when I'm running this script, it appears to just crop it and doesn't delete the inverted circular selection. However, if I interact with the image in any way (click on it, duplicated it, copy/paste it, undo/redo), it will correct itself and show the properly cropped image with the deleted circular corners. When I first run the script, it also shows the incorrect image up at the top where you can pick which image you're working on, but after interacting with the image it will show the correct image. Here's an example:
The starting image that I create from the clipboard with Ctrl+Shift+V (after screenshotting it from the game using PrtScr):
Then, I run the script, which results in this:
At the top of the screen, the image shows up like this (which is the top left 152x152 pixels of the starting image:
How the image looks once I interact with it in any way (clicking on it, copy/pasting it, duplicating it, undoing/redoing the operation):
The thumbnail at the top of the screen after I interact with the image:
Maybe it's getting hung up on something during the operation? I'm not sure. I understand if this issue is unavoidable, but I would prefer to be able to just run the script and move on rather than having to interact with the image to get it to show up correctly. The image does have an alpha layer when it's pasted in.
gimp-item-delete is a memory/object management thing and is rarely used. What you are looking for is gimp-drawable-edit-clear.
Note that it should be done (together with your final gimp-selection-none) before gimp-image-undo-group-end if you want your whole script to be undone by a single Ctrl-Z.
Edit: It appears that your code works, it's just that the display isn't updated to show the result, which is exactly what gimp-display-flush is meant to do, so why is your code calling it before gimp-drawable-edit-clear? gimp-display-flush ought to be about the last thing done by your script.
I used this code to display multiple images in the same namedWindow. Now I want to display some of the calculation results (that I have calculated before with image processing functions).
The results should be displayed in the fourth position of the namedWindow, like I show in the red square in the image below:
Is there any way in opencv that can throw console window in the namedWindow? Can I copy the results from console window in any other way on the named window? Is it possible to create somehow scrolling window with all information and put them on ?
I would suggest creating an new Mat with either ones() or zeros() and then using the function putText to insert your text.
Afterwards show the Mat like the rest before
i have a code which gives several images as ouput and i want to set all these images in particular axes in GUI in matlab. I'm trying to make a GUI of the code.
For eg.
figure,imshow(s1);
figure,imshow(s2);
figure,imshow(s2&s1);
and i want to set the output image of first command in, say axes3, output image of second command in axes4 and similarly last output image in axes5.
Although i know i need to use
set(handles.axes...)
command but i don't know the exact syntax on how to make the image be shown in particular axes.
Please give explain on how to make this happen with any suitable example. Thanks in advance.
One line solution (for each image) is to set the axis as the parent of the image within the imshow command;
imshow(image_Data,'Parent',handles.axes1)
There should be no need to open the additional figure windows ( assuming the axes are with the gui...)
So specifically for the question above:
imshow(s1,'Parent',handles.axes3);
imshow(s2,'Parent',handles.axes4);
imshow(s2&s1,'Parent',handles.axes5);
First you should create an axes box in your gui, then in tag section get a name i.e. (original) and finaly in editor when you want to use it code something like this
A = imread (Path);
axes(handles.original);
imshow(A);
I hope to help you...
The main idea: a user creates a powerpoint file with 1 slide, and this slide is inserted into a slideshow which is already looping.
A first idea I had was to convert the .ppt file into an image (e.g. using http://www.artofsolving.com/opensource/jodconverter/ or a .NET API), and then create a flash application which scans a directory for images(/converted slides) to show.
But this seems a bit like a complex solution, any suggestions?
You can achieve this using the insert object feature in PowerPoint.
Choose Insert from file
Select the powerpoint file
Check Link Checkbox
And its done. Any changes in the linked file are reflected in the already looping show. Let me know if you don't get it.
I m working in delphi-2010
i have an imagelist,in which i have added some .png images.
and i have also picture for showing the picture from imagelist.
i want to show the picture on picture box from imagelist.
i wrote the following code,but here addImage(,) takes 2 argument
one is Values:TCustomImagelist
and another is Index of Image
how i identify the value of customimagelist.
image1.Picture:=imagelist1.AddImage( , );
TImageList.AddImage adds a single image from one TImageList to another. I don't think this is what you intended.
If you want to show one of the images from a TImageList in a TImage, you could use something like this:
imageList1.GetBitmap(0, image1.Picture.Bitmap);