Here you are.
Yes, actually you drew onto the forelayer of the form.
I have modified the program and added some other stuff.
A setup panel with font size and font style. A Draw circle function.
The pen object in the ImageLibEx library allows drawing lines with different thicknesses.
Be carefull with the drawing coordinates in the program:
- x and y in the Mouse routines are screen coordinates usefull for the forelayer
- sx1, sy1, sx2, sy2 are memorized screen coordinates for forelayer drawing similar to x and y.
- x1, y1 ,x2 ,y2 are claculated coordinates to draw onto the image
Drawing functions:
- for the form's forelayer use the form forelayer drawing functions like frmMain.FLine etc
- for the image you MUST use the drwImage DrawerEx functions like drwImage.DrawLine etc.
I have set the text drawing function back to the right coordinates in the MouseUp routine. You modyfied it to:
[FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]drwImage.DrawString1(txtText.Text,brush1.Value,x,y-[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]70[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]) [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]' draws final text with it's color[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
with x and y-70. But if you move the image the text is NOT drawn on the right place, it's always drawn at the same place ! You had to add -70 the display offset.
I set it back to it's original text, using x2 and y2 coordinates:
[FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]drwImage.DrawString1(txtText.Text,brush1.Value,x2,y2) [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]' draws final text with it's color[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
These coordinates are calculated with ScreenX, ScreenY according to the offset of the display on the screen and with ScreenX0, ScreenY0 according to the offset of the displayed part in the image.
[FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]x2=ScreenX0-ScreenX+x [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]' calculates the image X2 coordinate[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]y2=ScreenY0-ScreenY+y [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]' calculates the image Y2 coordinate[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
Attached the new version.
Have fun in adding other functions and best regards.