Author |
Topic  |
|
jenswahl
 
Germany
74 Posts |
Posted - Feb 23 2012 : 01:16:30
|
Hello,
I have the following problem: I want the background of a TImageEnView (in example: ievPict) to fill with a special color, e.g. clBlack. I do this so:
ievPict.Clear; ievPict.Proc.Fill(slbColor.Color); //slblColor is a TsListBox This works fine. But if I load an image with hasn't the same ratio like ievPict (ievPict.AutoFit must be True) then I get above and under the bitmap a WHITE row: strPict.Seek(0, soFromBeginning); //strPict is a TStream ievPict.IO.LoadFromStream(strPict); ievPict.Update; How can I get this rows in my wanted color? I tried some with LayersMergeAll and others but without a wanted result. I'm using Release 3.1.2. Kind Regards
Jens
 |
|
xequte
    
39053 Posts |
Posted - Feb 23 2012 : 01:29:58
|
Hi Jens
Can you tell us more about your intention with this?
Are you looking to set the background color of the whole TImageEnView (c.f. ImageEnView.Background := clRed;) or just the background of the loaded image?
Nigel Xequte Software www.xequte.com nigel@xequte.com
|
 |
|
jenswahl
 
Germany
74 Posts |
Posted - Feb 23 2012 : 06:24:11
|
Hi Nigel,
I want to set the color of the two white rows and this is the background of the loaded image (I think). Setting the background of the TImageEnView-Object works till I load an image.
Jens. |
 |
|
fab
   
1310 Posts |
Posted - Feb 23 2012 : 13:44:39
|
Hi Jens, are you sure that the white background is not part of the loaded image? If this is the case you could try to remove the white border with:
ImageEnView1.Proc.AutoCrop(10, CreateRGB(255,255,255));
BTW: CreateRGB is defined in imageenproc unit. |
 |
|
jenswahl
 
Germany
74 Posts |
Posted - Feb 23 2012 : 23:31:10
|
Hi Nigel,
thank you for your suggestion but it doesn't works. The images are *.jpg embedded in mp3-files (an image of the album-cover) and will be shown using LoadFromStream. The most images have a size of 600x600 pixels (an so my ImageEnView-object), but the one showed in my first post has only 600x537 pixels. I use the following settings for ImageEnview1: Autocenter = True, LegacyBitmap = False, AutoFit = True, AutoShrink = False, AutoStretch = False, ZoomFilter = rfBell
Jens |
 |
|
jenswahl
 
Germany
74 Posts |
Posted - Feb 23 2012 : 23:33:53
|
Sorry, I meant Fabrizio!
Jens. |
 |
|
fab
   
1310 Posts |
Posted - Feb 24 2012 : 00:04:21
|
Please could you post this image? |
 |
|
jenswahl
 
Germany
74 Posts |
Posted - Feb 24 2012 : 00:41:58
|
Hi Fabrizio,
I attached the image.
 |
 |
|
fab
   
1310 Posts |
Posted - Feb 24 2012 : 01:40:14
|
This image hasn't a background, so if you set TImageEnView background to black you will not see white bands. For example:
ImageEnView1.IO.LoadFromFile('201222404134_ieforum.jpg'); ImageEnView1.BackgroundStyle := iebsSolid; ImageEnView1.Background := clBlack;
|
 |
|
jenswahl
 
Germany
74 Posts |
Posted - Feb 24 2012 : 02:10:06
|
Thank you, fabrizio,
my mystake was the false seuqence: I firstly set the Background and after them I loaded the image. Now it works fine. |
 |
|
|
Topic  |
|