timage

How to load a small system icon?

本小妞迷上赌 提交于 2019-12-12 07:06:50
问题 I need to display 16x16 pixel icons for error/warning/information. Unfortunately both LoadIcon(0, IDI_*) and LoadImage(0, OIC_*, IMAGE_ICON, 16, 16, LR_SHARED) always give me the 32x32 version of the icon. I read about ShGetStockIconInfo but that is only available from Vista onwards and I still need to support XP. Any ideas? I'm using Delphi 2010 with a TImage component if that matters. 回答1: The problem is that when you do it this way you get a cached version of the icon, the first one that

How to display a TBitmap with alpha channel on TImage correctly?

别来无恙 提交于 2019-12-10 19:56:51
问题 I have a TBitmap which contains semi-transparent image with alpha channel (in this example I got it from TPngImage). var SourceBitmap: TBitmap; PngImage: TPngImage; begin PngImage := TPngImage.Create(); SourceBitmap := TBitmap.Create(); try PngImage.LoadFromFile('ImgSmallTransparent.png'); SourceBitmap.Assign(PngImage); SourceBitmap.SaveToFile('TestIn.bmp'); imgSource.Picture.Assign(SourceBitmap); finally PngImage.Free(); SourceBitmap.Free(); end; When I save this TBitmap to a TestIn.bmp file

Why doesn't this D2006 code to fade a PNG Image work?

删除回忆录丶 提交于 2019-12-10 19:34:56
问题 This question springs from an earlier one. Most of the code is from suggested answers that probably worked in later versions of Delphi. In D2006 I don't get the full range of opacity, and the transparent part of the image shows as white. Image is from http://upload.wikimedia.org/wikipedia/commons/6/61/Icon_attention_s.png. It is loaded from the PNGImageCollection into the TImage at run-time because I have found you have to do this as the image doesn't remain intact after the DFM is saved. For

Controls on top, like TPanel can do?

纵饮孤独 提交于 2019-12-08 10:17:50
问题 My program is doing a time consuming task, and I would like to display a TImage in the middle of the application window, but it will not stay on top - my VST is always on top. However, when I use a TPanel, it stays on top? How can I make my TImage do that? In fact, a solution that applies to all controls would be splendid :) Thanks! 回答1: You need a windowed control (that is, a control with a window handle, or a "proper" control) to display your message, because a non-windowed control cannot

Loading images into TImage, via array

◇◆丶佛笑我妖孽 提交于 2019-12-08 05:37:53
问题 I'm very new to delphi, doing a project for my A level. When I run my code the images just don't show, I've looked everywhere and my teacher can't help me. Can anyone tell me what I'm missing? const Animal : array[0..6] of string = ('Bears','Dogs','Cats','Chickens','Horses','Cows','Monkeys'); ImagePaths : array [0..6] of string = ('img0.JPG', 'img1.JPG', 'img2.JPG', 'img3.JPG', 'img4.JPG', 'img5.JPG', 'img6.JPG'); var i:integer; Images : array [0..11] of TImage; procedure LoadImages; var k,l

FireMonkey iOS RAD Studio XE2 - Display Image on form loaded from URL

岁酱吖の 提交于 2019-12-05 10:30:56
问题 Is it possible to place a TImage on an FMX form for iOS and load image (jpg) from an URL into this TImage to be displayed in the iOS app? I have tried with no success. Any hints or point in the right direction is appreciated. 回答1: Drop a TButton, TImageControl and TIdHttp onto a Firemonkey form and this code will pull down an image from the web: procedure TForm1.btnReadWebImgClick(Sender: TObject); begin ReadWebImage('http://www.gravatar.com/avatar/5af5f8c5f88c6c237745e9472a31410f?s=32&d

FireMonkey iOS RAD Studio XE2 - Display Image on form loaded from URL

扶醉桌前 提交于 2019-12-03 22:44:06
Is it possible to place a TImage on an FMX form for iOS and load image (jpg) from an URL into this TImage to be displayed in the iOS app? I have tried with no success. Any hints or point in the right direction is appreciated. Drop a TButton, TImageControl and TIdHttp onto a Firemonkey form and this code will pull down an image from the web: procedure TForm1.btnReadWebImgClick(Sender: TObject); begin ReadWebImage('http://www.gravatar.com/avatar/5af5f8c5f88c6c237745e9472a31410f?s=32&d=identicon&r=PG'); end; procedure TForm1.ReadWebImage(imgAddress: string); var memStream: TMemoryStream; begin

JPEG data-stream to TImage

此生再无相见时 提交于 2019-11-30 19:28:23
I have some image-files stored into one file (some kind of archive). That file looks like this: Well, it's separated into two segments - header and data-segment. Header (green) contains various info, such as album name, location, date/time, description, number of photos in the album, etc. Data segment (blue & orange) has simple structure and it contains N x JPEG photo. I can extract that "imagedata" segment into new TMemoryStream object and now I want to show it using TImage. I can use SaveAsFile method of TMemoryStream, set some temporary file-name, load that file from TImage, and later,

How do I get the coordinates of the mouse when a control is clicked?

六月ゝ 毕业季﹏ 提交于 2019-11-30 12:57:22
In a TImage's OnClick event, I would like to extract the x,y coordinates of the mouse. I would prefer them in relation to the image, but in relation to the form or window is just as good. Mouse.CursorPos contains the TPoint, which in turn contains the X and Y position. This value is in global coordinates, so you can translate to your form by using the ScreenToClient routine which will translate screen coordinates to window coordinates. According to the Delphi help file, Windows.GetCursorPos can fail, Mouse.CursorPos wraps this to raise an EOsException if it fails. var pt : tPoint; begin pt :=

JPEG data-stream to TImage

。_饼干妹妹 提交于 2019-11-30 03:15:16
问题 I have some image-files stored into one file (some kind of archive). That file looks like this: Well, it's separated into two segments - header and data-segment. Header (green) contains various info, such as album name, location, date/time, description, number of photos in the album, etc. Data segment (blue & orange) has simple structure and it contains N x JPEG photo. I can extract that "imagedata" segment into new TMemoryStream object and now I want to show it using TImage. I can use