ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 White rows on black background
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

jenswahl

Germany
74 Posts

Posted - Feb 23 2012 :  01:16:30  Show Profile  Reply
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  Show Profile  Reply
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
Go to Top of Page

jenswahl

Germany
74 Posts

Posted - Feb 23 2012 :  06:24:11  Show Profile  Reply
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.
Go to Top of Page

fab

1310 Posts

Posted - Feb 23 2012 :  13:44:39  Show Profile  Reply
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.
Go to Top of Page

jenswahl

Germany
74 Posts

Posted - Feb 23 2012 :  23:31:10  Show Profile  Reply
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
Go to Top of Page

jenswahl

Germany
74 Posts

Posted - Feb 23 2012 :  23:33:53  Show Profile  Reply
Sorry, I meant Fabrizio!

Jens.
Go to Top of Page

fab

1310 Posts

Posted - Feb 24 2012 :  00:04:21  Show Profile  Reply
Please could you post this image?
Go to Top of Page

jenswahl

Germany
74 Posts

Posted - Feb 24 2012 :  00:41:58  Show Profile  Reply
Hi Fabrizio,

I attached the image.

Go to Top of Page

fab

1310 Posts

Posted - Feb 24 2012 :  01:40:14  Show Profile  Reply
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;
Go to Top of Page

jenswahl

Germany
74 Posts

Posted - Feb 24 2012 :  02:10:06  Show Profile  Reply
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.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: