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

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.

Related

how to add previous,play/stop,next in windows 10 minimizes

how to add Previous,Play/Stop,Next into my electron app same as in Spotify
I don't know how to make or do that
Thumbnail Toolbars in Electron
To set thumbnail toolbar in your application, you need to use BrowserWindow.setThumbarButtons.
win.setThumbarButtons(buttons)
Add a thumbnail toolbar with a specified set of buttons to the thumbnail image of a window in a taskbar button layout. Returns a Boolean object indicates whether the thumbnail has been added successfully.
The documentation follows, not a lot to explain there.

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

Windows ribbon split button gallery button image

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.

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

Picturebox controls and memory

I am planning on using many pictureboxes as controls instead of e.g. buttons, mostly because the controls need to look like icons and not buttons. Would pictureboxes kill memory too much when compared with buttons? Is there a way to make a button appear as an icon instead of a picturebox, that is, can a button be made to look like a .png small icon image file instead of a button with no border?
Lastly, there will be several tabs available to the user via a tabcontrol, each of which has maybe 10-15 pictureboxes that can be clicked on. Is there a shortcut for addhandler if many pictureboxes are used within a tab as a replacement for a buttonbar (no longer supported in VB.NET 2010)?
The button control SUPPORTS pictures already!
Most likely too (more importantly!) the buttonis LIGHTWEIGHT and will consume less memory than pictureboxes
Use the Property sheet to assign the image(s)
You can assign a different image for the button up and down states too!!

Resources