Jump to content

writing on screen

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
29 replies to this topic

#1
ikkeugh

ikkeugh

    Learning Programmer

  • Members
  • PipPipPip
  • 79 posts
Is there a way so you could just draw on the screen ?
Like in a powerpoint presentation where you can use markers , or in paint only without paint .

See it this way : you take a marker in your hand and start drawing on your screen , free-hand .

PS don't do that :p

#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
You can track your mouse pixels and wherever your mouse is draw a pixel. You can have a selection that would allow you to change the pixel colors and size.

To draw on the desktop you would have to make the main screen transparent. This would make it appear as though you are drawing on the actual desktop.

Here is code to get you started: VB Paint: Emulates MS Paint with Additional Features

#3
ikkeugh

ikkeugh

    Learning Programmer

  • Members
  • PipPipPip
  • 79 posts
no , i'm really talking on writing on the screen , not on a form .
Is this possible ?
Maybe an API to change the color the pixel has .

#4
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
Will a transparent Big Form (that covers the screen) do it? or you have something else in mind?

#5
ikkeugh

ikkeugh

    Learning Programmer

  • Members
  • PipPipPip
  • 79 posts
well , is there another solution (without an other form ? )
Or how to do this without modules ?
It should only draw a figure (circle) and if you hold the cursor down and move it , everything turns into that collor that the user chooses .
If you look at the paint exemple with modules , the figure should be the largest pensel .

#6
ikkeugh

ikkeugh

    Learning Programmer

  • Members
  • PipPipPip
  • 79 posts
I found one, I tought it would be less easier .now , how to change the color and the drawing figure ?

'Variables used for the drawing tool.

Dim Drawing As Boolean

Dim FHLastX As Long

Dim FHLastY As Long



Private Sub Form_Load()

Drawing = False

End Sub


Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

    

    'Specify that we are drawing now.

    Drawing = True

    

    'Start where the mouse cursor is.

    FHLastX = X

    FHLastY = Y


End Sub


Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

    

    'This is the technique we are using to

    'draw freehand decently. Instead of drawing each point,

    'we join the points up with lines. This is required as the

    'MouseMove event will not fire on every pixel.

    If Drawing = True Then

    Form1.Line (FHLastX, FHLastY)-(X, Y)

    FHLastX = X

    FHLastY = Y

    End If


End Sub


Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

    

    'Stop drawing.

    Drawing = False


End Sub


#7
ikkeugh

ikkeugh

    Learning Programmer

  • Members
  • PipPipPip
  • 79 posts
How do I get focus on the first form without clicking the second ?
It's in the zip file
Still to do : focus the first form
change the color
make the second form transparant

Attached Files



#8
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
Please include the addon 'etShapedForm.ocx' so I can have a better look. Thanks.

#9
Xyphos

Xyphos

    Newbie

  • Members
  • Pip
  • 7 posts
It's not advisable to write directly to the desktop window, but if you really insist, you'd first have to create a DIB handled by a SAFEARRY so you can access the DIB's pixels directly.

once that's done, just get the Desktop window's DC and BitBlt.

#10
ikkeugh

ikkeugh

    Learning Programmer

  • Members
  • PipPipPip
  • 79 posts
I'm so sorry , this should be better ...

Attached Files



#11
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
Well I don't see any drawing on screen.. it's just drawing on a normal form?!

#12
ikkeugh

ikkeugh

    Learning Programmer

  • Members
  • PipPipPip
  • 79 posts
Because it isn't working !!!