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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 How to remove a drawn Border from thumbnail?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
yogiyang Posted - Jul 09 2016 : 07:53:45
Hello,

I am using following code to draw border around thumbnails:
iemPhotos.SelectedImage := j;
iemPhotos.IEBitmap.Canvas.Pen.Color := TRGB2TColor(CreateRGB(0, 255, 0));
iemPhotos.IEBitmap.Canvas.Pen.Width := 7;
iemPhotos.IEBitmap.Canvas.Brush.Style := bsClear;
iemPhotos.IEBitmap.Canvas.Rectangle(1, 1, iemPhotos.IEBitmap.Width, iemPhotos.IEBitmap.Height);

Now if I want to remove this border how can I do it?

TIA


Yogi Yang
5   L A T E S T    R E P L I E S    (Newest First)
yogiyang Posted - Jul 13 2016 : 10:44:23
Thanks Bill.

I will look into this.

Actually I was searching for Draw event and it is ImageDraw event.

How stupid of me.


Yogi Yang
w2m Posted - Jul 13 2016 : 09:13:58
Just look in the events in the help file:
// Display the image index and sizes on bottom of the thumbnail
// Ensure you have set the BottomGap property
procedure TForm1.ImageEnMView1ImageDraw(Sender: TObject; idx: Integer; Left, Top: Integer; Canvas: TCanvas);
begin
  with canvas do
  begin
    Font.Height := 15;
    Font.Color := clWhite;
    TextOut(Left, Top + imageenmview1.ThumbHeight - imageenmview1.bottomgap + 2, IntToStr(idx));
    TextOut(Left, Top, IntToStr(imageenmview1.ImageWidth[idx]) + 'x' + IntToStr(imageenmview1.ImageHeight[idx]));
  end;
end;

Declaration
property OnImageDraw2: TIEImageDraw2Event;

Description
Occurs whenever an image is painted. Same as OnImageDraw but includes ImageRect to return the thumbnail rectangle.

Here is some code that draws a rect around the thumbnail if the thumbnail height is > thumbnail height (Portrait).

procedure TForm1.ImageEnMView1ImageDraw(Sender: TObject; idx, Left, Top: Integer; Canvas: TCanvas);
{Draw a green rect if the thumbnail is portrait}
var
  iWidth: integer;
  iHeight: integer;
begin
  iWidth := ImageEnMView1.ImageOriginalWidth[idx];
  iHeight :=  ImageEnMView1.ImageOriginalHeight[idx];
  if iHeight > iWidth then
  with Canvas do
  begin
    Pen.Color := TRGB2TColor(CreateRGB(0, 255, 0));
    Pen.Width := 4;
    Brush.Style := bsClear;
    Canvas.Rectangle(Left, Top, Left + ImageEnMView1.ThumbWidth, Top + ImageEnMView1.ThumbHeight);
  end;
end;


Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
yogiyang Posted - Jul 13 2016 : 06:23:05
Hello,

But I am using ImageEnMView.

Is it possible to save undo for each thumbnail?

I could not find Draw Event.

And I am highlighting the images that are Portrait by drawing a border around them.

Is there any other way to highlight images of interest in ImageEnMView?

TIA


Yogi Yang
xequte Posted - Jul 09 2016 : 17:42:58
Yes, you would be better to paint to the canvas in one of the draw events.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
w2m Posted - Jul 09 2016 : 15:27:47
Your code paints the bitmap pixels so there is no way that I know of to remove the border unless you use save undo and undo or replace the bitmap with a copy of the original bitmap. If the border was painted on a transparent layer, then if could be removed if the layer is deleted.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development