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
 Transparent Image in front of ImageEnView

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
anprosh Posted - Dec 01 2011 : 04:27:43
Help me, please.

I need to place crosshairs in front of ImageEnView1.
I use Image1 for it.

All events of the mouse passed throw Image1 to ImageEnView1 correctly,
Zoom and Pan works correctly, but the crosshairs are not visible.

I have reduced the sizes ImageEnView1,
and have seen that crosshairs are visible in Image1 only.

For Image1 Transparent=true
and is executed Bring to front.

Why I don't see the crosshairs in ImageEnView1 area?


+----------------:-----+-----+
| : | |
| : | |
|................:.....|-----|
| : | |
| ImageEnView1 : | |
| : | |
+----------------:-----+ |
| Image1 | |
| Transparent | |
| Bring to front | |
+----------------------------+



It is a part of an source code:
===============================

Graphics::TBitmap*Cross;
Copy = new Graphics::TBitmap();
.....................

void __fastcall TForm1::ImageEnView1MouseMove(TObject *Sender,
TShiftState Shift, int X, int Y)
{
if (Shift.Contains(ssAlt))
{
PatBlt(Cross->Canvas->Handle, 0, 0,Image1->Width, Image1->Height, WHITENESS);
Cross->Canvas->MoveTo(X,0);
Cross->Canvas->LineTo(X,Image1->Height);
Cross->Canvas->MoveTo(0,Y);
Cross->Canvas->LineTo(Image1->Width,Y);
Image1->Canvas->Draw(0,0,Cross);
Image1->Refresh();
}
if (Shift.Contains(ssRight))
{
//brightness, contrast
.....................
}
}
................

//--------------------------------------------------------------------
void __fastcall TForm1::Image1MouseMove(TObject *Sender, TShiftState Shift,
int X, int Y)
{
ImageEnView1MouseMove(ImageEnView1, Shift, X, Y);
}

//--------------------------------------------------------------------
void __fastcall TForm1::Image1MouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y)
{
ImageEnView1MouseDown(ImageEnView1, Button, Shift, X, Y);
}

//--------------------------------------------------------------------
void __fastcall TForm1::Image1MouseUp(TObject *Sender, TMouseButton Button,
TShiftState Shift, int X, int Y)
{
ImageEnView1MouseUp(ImageEnView1,Button, Shift, X, Y);
}
2   L A T E S T    R E P L I E S    (Newest First)
anprosh Posted - Dec 01 2011 : 10:36:08
Thanks for help, Fabrizio, it works Ok now.
fab Posted - Dec 01 2011 : 07:46:14
I can suggest a solution that uses only ImageEn:

- define two field, like MouseX and MouseY.

- handle the event TImageEnView.OnMouseMove, just to save current mouse position and update ImageEn viewer:
procedure TForm1.ImageEnView1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
  MouseX := X;
  MouseY := Y;
  ImageEnView1.Update();
end;


- handle the event TImageEnView.OnDrawBackBuffer, to draw the cross:
procedure TForm1.ImageEnVect1DrawBackBuffer(Sender: TObject);
begin
  ImageEnView1.BackBuffer.Canvas.Pen.Color := clRed;
  ImageEnView1.BackBuffer.Canvas.MoveTo(MouseX, 0);
  ImageEnView1.BackBuffer.Canvas.LineTo(MouseX, ImageEnView1.BackBuffer.Height);
  ImageEnView1.BackBuffer.Canvas.MoveTo(0, MouseY);
  ImageEnView1.BackBuffer.Canvas.LineTo(ImageEnView1.BackBuffer.Width, MouseY);
end;


Hope this helps.