Windows ribbon split button gallery button image - delphi

I'm using Windows Ribbon for Delphi (from http://www.bilsen.com/windowsribbon/commands.shtml) and I have a split-button gallery, to give a drop-list of items that I can populate at runtime.
The part that isn't working is when I select an item from the gallery, its image isn't automatically transferred to the split button and I can't find a way to make it happen manually.
I've tried looking through the MS documentation but I can't see anything there that helps change the image of the button.
For the avoidance of doubt: I've checked in MSPaint and the brush selection works exactly as I want my button to work.

Related

how to get image from TWebBrowser into a TImage

I have a panel at the top of a form with a smallish TMemo set up as a drop target for URLs. Below that I have a Page Control with 2 tabs. I set up a TWebBrowser in one tab and some other stuff in the second tab. In the TWebBrowser, I need to login to a bug ticketing site we have, then browse tickets. Certain tickets have links to small images that clients want us to use (think something like logos). I can left-click on them and then drag-n-drop the link from the TWebBrowser to the TMemo at the top of the form. That picks up the image's URL and Title as expected.
The associated OnDrop event also switches to the 2nd tab and where I click a "Process" button. That causes the browser to navigate to the image (via Navigate2), which it loads into the browser window. That image is all that's in the browser window at this point.
So now I need the code to grab the image and load it into a TImage on the 2nd tabsheet. FWIW, the original image is a PNG.
I'm able to get the height and width of the image from the target image, but I'm not getting the image itself to show up in the TImage most of the time. Sometimes, but mostly not. I can load PNGs into these image objects just fine, so I know it displays PNGs properly.
(Maybe there's a way to do a download the image directly, but I wasn't able to get that to work. The TWebBrowser is used to login to an internal bug ticketing system where the images are being provided, and I can access that site only if it's on the same form and I've logged in. Otherwise the DL loads an HTML login page instead of the image. If there's a way to do that in the current framework, I'm open to suggestions.)
I'm finding the image file on the web page using IHTMLElement2.getelementsByTagName('img') and grabbing the first one (since I know that's all there is on the web page).
img := getFirstImage;
Image1_frame.Height := img.height+2;
Image1_frame.Width := img.width+2;
rnd := img as IHTMLElementRender ;
rnd.DrawToDC(Image1.Canvas.Handle);
Image1 is aligned to Client on a panel named Image1_frame. So I set the frame's H & W -- they get set ok.
But the image is usually not visible. It's just white.
I see that DrawToDC is deprecated, but I haven't found what to replace it with.
You can use this approach to auto login (if needed) :
Automated Log In (webBrowser)
Then you can use this to get the Image: Image from TWebBrowser to TPicture

delphi firemonkey: how to use image area as a button?

in my Firemonkey android app, i want to use a area( or an object ) in an image(image is placed in a form) as a button, first i thought about getting touch/click area and process from there, but since device screen could change from device to device, i want to know how to handle this situation ..
just for demonstration see this picture
(source: chainimage.com)
i want to use each item as a button.
how do i do that ? thanks in advance.
Your use of the ImageList in Delphi.
All your images in convert to Png or Ico.
Bring all the images in the ImageList.
Button connects to the ImageList.
In the ImageIndex Button to choose your Image.
The greater Button, Image greater.
Using the image in the project, to increase the size of the project.
More information:
http://docwiki.embarcadero.com/Libraries/Berlin/en/FMX.ImgList.TImageList
I explained very simply.
The first one ImageList component in the app. After all it is expanded to upload your photos.
Then ImageIndex photos to assign button.

How can I extract a PNG from a delphi XE5 firemonkey style?

I'm trying to change the color used when elements of the MetropolisUIBlack.Style XE5 style (Firemonkey). It seems that, in order to do so, the simplest way would be to edit the PNG image that contains all these elements i the style (MetroBluestyle.png).
Unfortunately, I can't find a way to save the PNG that is contained in the style element to a file so I can manipulate it safely and reload it once the color has been changed.
Use the Bitmap Style Designer provided with the product.
You can find it in the Tools menĂ¹ and, once started, you simply have to open the MetropolisUIBlack.vsf file, select the "style.png" item under Images and click the Export button (above the right panel where you can see a preview of the picture).
Edit the picture with your favorite editor (i.e. The Gimp), save the picture, and load it back in the style using the Update button (just left the Export one).
You can save your style with a different name and use it as usual.
HTH

iPhone/iPad UI: seeking drop-down control

My universal app has a settings page, wherein the user must choose a theme from a dozen available themes.
Problem is, if I am using a picker-view, it takes up most of the screen on an iPhone.
I think what I want is something like your standard Windows drop-down menu, where it just displays on a single line the current selection, and clicking it expands into a scrollable list of possible items. Selecting an item collapses the list back into the original form.
So my question is: What is my best method for handling this situation? Can anyone point me to pictures or code examples of how this situation is handled successfully?
EDIT:
This is the behaviour I'm looking for:
only the currently selected profile is displayed
when the user taps on this, it expands into a list
when the user selects an item (or taps outside of the view) it collapses back to its original form, now displaying the new selection
ie functionally equivalent to a dropdown.
Firstly, this question is a duplicate of:
(not much good) Picker view as subview
(same) How to make an iPhone dropdown-looking button
(better) How to create drop down list box for an iphone app
(even better) Creating a drop-down list in iPhone app
(that last one links to some handy code)
Secondly, Google image search for 'dropdown control iphone' restricting the image size to 320x480 shows how everyone is doing this.
Basically a picker view scrolls in from the bottom, the same way as the keyboard does.

How to get the Preview image using advImage plugin in Rails application

HI ,
i am using Tinymce with advimage plugin in my rails application.
I have doubt that When i click on the Insert/Edit iamge in the Tinymce a popup window comes and in the appearance tab the preview is not shown
How to get the preview image ?? in the Appearance tab
There are two "previews" in the Advanced Image plugin dialog. The first is the preview of the image you have selected. The second is to allow you to visualise what the style changes you make (for instance border, alignment) would look like and uses an "sample" image.
I assume what you would like to see is your selected image displayed instead of the "sample" image. To achieve this, you will need to alter the advimage plugin, which is bundled with TinyMCE, to use the currently selected image instead of the default (sample.gif).
One thing to consider is that if your end user selects a large image, then they wouldn't be able to see the application of the style changes within the small preview window.

Resources