DrawLine Method in PictureBox Control of eVB? 
Author Message
 DrawLine Method in PictureBox Control of eVB?

I would like to create a drawing form where I can make anything with mouse
just like paint.

In VB-6, I used following codes.

Picturebox1_Mousedown(---)
picturebox1.currentx=X
picturebox1.currenty=Y
End Sub

Picturebox1_MouseMove(---)
if button=1 then
picturebox1.line (picturebox1.currentx,picturebox1.currenty)-(x,y)
endif
End Sub

How can I do something like this in Embedded Visual Basic as there is no
CurrentX or CurrentY property in Picturebox control of eVB ?

Best Regards,

Luqman



Mon, 12 May 2003 15:01:08 GMT  
 DrawLine Method in PictureBox Control of eVB?
I've done this. You have to maintain several module level variables nSaveX,
nSaveY. Then in the mouse down event set these variables. In the mouse move
event draw a line between the saved values and the current values from the
event and then update the saved values with the current values. It works
pretty well. I just haven't figured out a way to save the image yet. Any
help here would be appreciated.

Quote:
> I would like to create a drawing form where I can make anything with mouse
> just like paint.

> In VB-6, I used following codes.

> Picturebox1_Mousedown(---)
> picturebox1.currentx=X
> picturebox1.currenty=Y
> End Sub

> Picturebox1_MouseMove(---)
> if button=1 then
> picturebox1.line (picturebox1.currentx,picturebox1.currenty)-(x,y)
> endif
> End Sub

> How can I do something like this in Embedded Visual Basic as there is no
> CurrentX or CurrentY property in Picturebox control of eVB ?

> Best Regards,

> Luqman



Sat, 17 May 2003 03:00:00 GMT  
 DrawLine Method in PictureBox Control of eVB?
If you want to save the bitmap use the S309PictureBox from
http://members.xoom.com/S309

-Terry


Quote:
> I've done this. You have to maintain several module level variables
nSaveX,
> nSaveY. Then in the mouse down event set these variables. In the mouse
move
> event draw a line between the saved values and the current values from the
> event and then update the saved values with the current values. It works
> pretty well. I just haven't figured out a way to save the image yet. Any
> help here would be appreciated.


> > I would like to create a drawing form where I can make anything with
mouse
> > just like paint.

> > In VB-6, I used following codes.

> > Picturebox1_Mousedown(---)
> > picturebox1.currentx=X
> > picturebox1.currenty=Y
> > End Sub

> > Picturebox1_MouseMove(---)
> > if button=1 then
> > picturebox1.line (picturebox1.currentx,picturebox1.currenty)-(x,y)
> > endif
> > End Sub

> > How can I do something like this in Embedded Visual Basic as there is no
> > CurrentX or CurrentY property in Picturebox control of eVB ?

> > Best Regards,

> > Luqman



Sun, 18 May 2003 03:00:00 GMT  
 DrawLine Method in PictureBox Control of eVB?
Luqman,

The module level variables work fine.  You have to reset the values in
mouseup so you are not limited to a continuous line.

Instead of saving the image, you can save the X,Y coordinates as the image
is drawn.  If you require a bitmap on the hand-held for e-mailing or
printing, then you'll have to use the PictureBox309 control
(http://members.nbci.com/S309/).  If you want to re-display the image on the
PocketPC and/or send it to a host VB program, then you don't need the S309
control, you can simply re-draw it in a picturebox using the saved
coordinates.  Once re-drawn on a host VB application it can be saved to a
bitmap.

If you keep your picturebox scalesize to about 250x250, you can still have
full screen drawings with acceptable resolution.  The 250 limit will allow
you to save each coordinate as a character, and the whole set of coordinates
as a character string.  You will need to reserve a special value for mouseup
actions or else your drawings will always be a continuous line.

-Lee


Quote:
> I've done this. You have to maintain several module level variables
nSaveX,
> nSaveY. Then in the mouse down event set these variables. In the mouse
move
> event draw a line between the saved values and the current values from the
> event and then update the saved values with the current values. It works
> pretty well. I just haven't figured out a way to save the image yet. Any
> help here would be appreciated.


> > I would like to create a drawing form where I can make anything with
mouse
> > just like paint.

> > In VB-6, I used following codes.

> > Picturebox1_Mousedown(---)
> > picturebox1.currentx=X
> > picturebox1.currenty=Y
> > End Sub

> > Picturebox1_MouseMove(---)
> > if button=1 then
> > picturebox1.line (picturebox1.currentx,picturebox1.currenty)-(x,y)
> > endif
> > End Sub

> > How can I do something like this in Embedded Visual Basic as there is no
> > CurrentX or CurrentY property in Picturebox control of eVB ?

> > Best Regards,

> > Luqman



Sat, 24 May 2003 03:00:00 GMT  
 DrawLine Method in PictureBox Control of eVB?
Dear Terry,

Could you please give me an example code as to how can I save current X and
Y values in Module Level Variables.

Best Regards,

Luqman


Quote:
> If you want to save the bitmap use the S309PictureBox from
> http://members.xoom.com/S309

> -Terry



> > I've done this. You have to maintain several module level variables
> nSaveX,
> > nSaveY. Then in the mouse down event set these variables. In the mouse
> move
> > event draw a line between the saved values and the current values from
the
> > event and then update the saved values with the current values. It works
> > pretty well. I just haven't figured out a way to save the image yet. Any
> > help here would be appreciated.


> > > I would like to create a drawing form where I can make anything with
> mouse
> > > just like paint.

> > > In VB-6, I used following codes.

> > > Picturebox1_Mousedown(---)
> > > picturebox1.currentx=X
> > > picturebox1.currenty=Y
> > > End Sub

> > > Picturebox1_MouseMove(---)
> > > if button=1 then
> > > picturebox1.line (picturebox1.currentx,picturebox1.currenty)-(x,y)
> > > endif
> > > End Sub

> > > How can I do something like this in Embedded Visual Basic as there is
no
> > > CurrentX or CurrentY property in Picturebox control of eVB ?

> > > Best Regards,

> > > Luqman



Sun, 01 Jun 2003 12:19:59 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. about picturebox.drawline

2. e.Graphics.DrawLine Method

3. Graphics drawlines method

4. Using the DrawLine method in VB .NET

5. Flip a Picture in PictureBox control using PaintPicture Method

6. PictureBox Doesn't Work - eVB

7. PictureBox doesn't work - eVB

8. Optimize iteration in eVb / drawing using picturebox problem

9. Is there a eVB PictureBox.Drawmode bug?

10. eVB and the Shell method

11. DrawLine

12. Can't pass picturebox through interface method

 

 
Powered by phpBB® Forum Software