hi, i`ve got 2 imageboxes on each other.
the one at the bottom displays a picture (image1), the other one is for drawing (imagedraw).
imagedraw shows a line when i move the mouse on it, and if i move it a bit furthen than the previous line going to be deleted using "CLS", theres a "zoom" function which is changeing the size of the boxes, and strech them, when this happens the line has dissapear.
i want to add the line to imagedraw or image1 whitout deleting its content.
by the way, i think imagedraw is drawing the line in the form surface, but im not sure... - private sub imagedraw_mousemove.....
-
cls
-
line (x1, y1) - (x2, y2)
regards: Zsolt
You can solve this by placing an image and a line IN a picturebox. Use NOT Picturebox.Line because the line IS NOT AN ELEMENT and you can't scale or distort it.
Calculate, each time you make an adaption on the image, the new coordinates of the line.
Attached is a demo.
Draw the line by MouseDown - Drag - MouseUp in the image.
6 2756
Did you place the line in the PICTUREBOX (not possible to place a line in a IMAGEBOX !) ?
Try to cut the line and paste it in the PICTUREBOX.
Is it possible to attach your project in Bytes so I can see what you exactly want to do with the pictures?
You can't put a line in an imagebox, only in a picturebox.
This is the code: - Option Explicit
-
-
Dim Xstart As Integer
-
Dim Ystart As Integer
-
-
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
-
Xstart = X
-
Ystart = Y
-
End Sub
-
-
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
-
Picture1.Line (Xstart, Ystart)-(X, Y)
-
End Sub
sorry for late response
now i know i cant draw in an image box...
but i need to create 2 layers of image, the point is you`ll be able to look trough the one at the top to see the one at the back.
both must be an imagebox because i need to strech them.
i have an idea for this:
the pic at the back will allways be the same (except the strech function), and the one at the top shall allways ready for use...
now what if i draw a line by an imagebox (at a specified position) and draw a same line to a hidden picturebox with the imagebox mouse move function/event, save it to specified path, then open it in the top imagebox
i`ll be able to strech it, because im able to strech images wich are loaded as a picture.
but im stuck, i dont know how to save the drawn lines from the picturebox, it saves a blank picture.
i think this may work what do you think?
You can solve this by placing an image and a line IN a picturebox. Use NOT Picturebox.Line because the line IS NOT AN ELEMENT and you can't scale or distort it.
Calculate, each time you make an adaption on the image, the new coordinates of the line.
Attached is a demo.
Draw the line by MouseDown - Drag - MouseUp in the image.
Attached is an expurgated version with comments.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Matt |
last post by:
I am writing a recursive program to draw the lines recursively, given the
range and number of intervals (n) between the range.
The problem is I don't know how to draw the line in point 0.375, as...
|
by: Florida Draw |
last post by:
------=_NextPart_000_0012_1D5428A2.65C196F8
Content-Type: text/plain
Content-Transfer-Encoding: 8bit
Sign-up for the FREE Holiday Giveaway Draw
You must register to be eligible for the draw....
|
by: Matt |
last post by:
I am writing a recursive program to draw the lines recursively, given the
range and number of intervals (n) between the range.
The problem is I don't know how to draw the line in point 0.375, as...
|
by: cyshao |
last post by:
I opened an image and want to change its size, then display it in a
ImageBox.
How can I do that ?
Thanks
Charles Shao
|
by: Colin McGuire |
last post by:
Hi there. I have written a small procedure to draw various shapes on
things. A bit of it is shown below.
Private Sub drawShape(ByVal shapeType As Integer, ByRef g As Graphics)
Select Case...
|
by: zxo102 |
last post by:
Hi everyone,
I have tried two days to figure out how to draw the image in
wx.BufferedDC on the page created by AddPage of wx.Notebook but still
got no clue.
The attached example works fine. If...
|
by: ApexData |
last post by:
I have an ImageBox with PictureType set to LINK.
I have a string with a path strPicFolderPath = "C:\Pictures"
In the OnCurrent event of the form I have this code:
If...
|
by: zhaow |
last post by:
Hi, All
Greetings!
I want to develop as appllication that requires a line-drawing function
in the blank area between two forms. I have looked up the MSDN, it says that
a graphics object need a...
|
by: Niu Kun |
last post by:
Dear all,
I'm trying to draw many overlapped PNG files with transparent background
in imagebox control.
But the transparent background in this control is rendered as the main
control's...
|
by: Sumamadhavanitpark |
last post by:
1.loading image in to imagebox using http
2. help for ADrotator
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
| |