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);
Related
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.
For example if I insert picture in powerpoint name of that picture is changing but I want to be a same. Anyone knows how that works? Is changing name based on what?
Thank you
When you insert a picture onto a slide that contains nothing else, the new picture will be named Picture 1.
If you insert a picture onto a slide that contains two other shapes, the new picture will be named Picture 3.
In other words, the new shape will be named ShapeType & ShapeCount.
I have a macro that takes a range of cells, copies them as an image, and places them in a separate sheet. I would like to take the image, resize it, and place the correctly sized image into a different sheet.
Sub heatmapToJPEG()
Range("G1:V33").Select
Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
'places image of heat map into Setup tab
Sheets("Setup").Select
Range("M1").Select
ActiveSheet.Paste
End Sub
I would like to re-size the image one it is in the Setup tab, but when excel places it there, it gives it the default name of Picture 1, Picture 2, Picture 3, or whatever iteration I am on before closing and reopening the workbook.
Is there a way to assign a permanent variable name to the image found in the Setup tab? If so, my thinking was to assign it to the variable name, and pass it off to another sub for resizing and placement. I am sure there are better ways, but am hitting this roadblock.
It's bad practice all around but just add a .Name property at the end -
ActiveSheet.Paste
Selection.Name = "name"
Is it possible to output images so that they all will be inside a single window?
Before, I used to output data using only opencv functions:
cvNamedWindow("Image 1");
cvShowImage("Image 1", img);
So I change image, then call: cvShowImage function and so on.
But If I want to look at more than one image, then every new image needs its own window to be shown there And what I want is to put every such an output opencv's window inside one big main window.
Is it possible to do it? And how?
You will have to construct a new image and place each img into it. I don't think there's a builtin function like MATLAB's subplot. I recommend using the ROI functions to quickly copy an image into a region-of-interest (ROI) of the big image (which holds the others).
You can show as many images as you want on a single window using hconcat function.
Let us suppose your original image was
Mat frame;
Now clone or make a copy of this image using
Mat frame1 = frame.clone();//or
Mat frame2;
frame.copyTo(frame1);
Now let us suppose your output images are
Mat img1,img2,img3,img4;
Now if you want to show images horizontally, use
hconcat(img1,img2,frame1)//hconcat(input_image1,input_image2,destination_image);
And if you want to show images vertically, use
frame2.push_back(img1);//main_image.push_back(image_to_be_shown_below);
This process processess images one at a time, so if you want to show 4 images side by side, you have to call this function 4 times as in
hconcat(img1,img2,frame1);
hconcat(frame1,img3,frame1);
hconcat(frame1,img4,frame1);
imshow("Final Image",frame1);
NOTE:
Clone process is done because the images have to be of same size.
Enjoy...
I am having problems with a table containing checkboxes in Word.
I am working with a table containing 10 checkboxes. Next to this table, there is an image.
When the user checks one of the checkboxes, something has to be added to the image, i.e. the image is further completed.
However, the order of checking the checkboxes is not fixed or defined, so there are lots of different combinations.
Is there a way to add the additional parts to the original image, linked to the checkboxes? Or is this way too advanced for Word?
Word doesn't have this type of built-in functionality with images. There are too many state combinations for the checkboxes to make an image for each state in advance. One possibility could be to find a dll or ocx and draw the image programatically (advanced). Another would be to edit your image in photoshop and cut it up into 10 separate files using a transparent background. You could then add and remove layers to wherever you are displaying your image and control the z-ordering with vb.