Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact
A1VBCode Forums
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      

Home » Classic Visual Basic (VB 6 or earlier) » General Visual Basic » Digitize Part of Bitmap Image

30 posts, Page 3 of 3. «««123

Digitize Part of Bitmap ImageExpand / Collapse
Author
Message
Posted 9/1/2010 2:32:05 PM
Forum God

Forum God

Group: Moderators
Last Login: Yesterday @ 1:42:32 PM
Posts: 1,073, Visits: 9,408
The code I posted above would do it. The specific thing you need to do is set the MousePointer property of the picturebox to the desired pointer. In this case vbCrosshair or 2. I prefer to do this in either the load event or the properies list but the MouseMove event works too.

Private Sub Form_Load()
    Picture1.MousePointer = vbCrosshair
End Sub
Post #29580
Posted 9/1/2010 2:33:21 PM


Forum God

Forum GodForum GodForum GodForum GodForum GodForum GodForum GodForum God

Group: Forum Members
Last Login: 12/4/2011 11:46:01 PM
Posts: 545, Visits: 2,544
I stumbled upon a VB quirk and thought I'd share it. In my last post I used MousePointer = 2 that can be replaced with textual constant of MousePointer = vbCrossHair. However, if you inadvertently make this typo... MousePointer = vbCross  

VB interprets it as:

MousePointer = vbSizeNESW

________________________________________________________________ 

"So much to learn. So little time to do it. Wise men know it's later than one thinks"!

Mark's Syntax.Zip    Pause Sub

I don't answer programming questions via PMs. That's what the forum is for! 

Post #29581
Posted 9/1/2010 2:44:14 PM
Forum God

Forum God

Group: Moderators
Last Login: Yesterday @ 1:42:32 PM
Posts: 1,073, Visits: 9,408
No real suprise. vbCross is a FillStyle constant with a value of 6. The same value as vbSizeNESW.
Post #29582
Posted 9/1/2010 2:47:09 PM


Forum God

Forum GodForum GodForum GodForum GodForum GodForum GodForum GodForum God

Group: Forum Members
Last Login: 12/4/2011 11:46:01 PM
Posts: 545, Visits: 2,544
Mark (9/1/2010)
The code I posted above would do it. The specific thing you need to do is set the MousePointer property of the picturebox to the desired pointer. In this case vbCrosshair or 2. I prefer to do this in either the load event or the properies list but the MouseMove event works too

Actually Mark, I think you putting it in the Form_Load is a better choice than mine. It's one less event that VB has to fire. The MouseMove fires repeatedly and now he has one less Sub to deal with.

________________________________________________________________ 

"So much to learn. So little time to do it. Wise men know it's later than one thinks"!

Mark's Syntax.Zip    Pause Sub

I don't answer programming questions via PMs. That's what the forum is for! 

Post #29583
Posted 9/1/2010 2:49:28 PM


Forum God

Forum GodForum GodForum GodForum GodForum GodForum GodForum GodForum God

Group: Forum Members
Last Login: 12/4/2011 11:46:01 PM
Posts: 545, Visits: 2,544
Mark (9/1/2010)
No real suprise. vbCross is a FillStyle constant with a value of 6. The same value as vbSizeNESW.

Ah, thanks for the explanation.

________________________________________________________________ 

"So much to learn. So little time to do it. Wise men know it's later than one thinks"!

Mark's Syntax.Zip    Pause Sub

I don't answer programming questions via PMs. That's what the forum is for! 

Post #29584
Posted 9/2/2010 12:05:46 AM


Forum God

Forum GodForum GodForum GodForum GodForum GodForum GodForum GodForum God

Group: Forum Members
Last Login: 12/4/2011 11:46:01 PM
Posts: 545, Visits: 2,544
La Vesey, I received yet another email from you and I'm sure other participants of this topic have also. Please stop doing that and please stop pasting the same statements repeatedly in this thread.  I don't believe that I need to post your last email to me because I'm guessing everyone else received the same thing.

Now that that's out of the way here's a simple question.. Have you run any of the code that's been posted in this thread?....And I do mean Any???

________________________________________________________________ 

"So much to learn. So little time to do it. Wise men know it's later than one thinks"!

Mark's Syntax.Zip    Pause Sub

I don't answer programming questions via PMs. That's what the forum is for! 

Post #29585
Posted 9/7/2010 3:17:41 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 1/25/2011 12:54:56 PM
Posts: 12, Visits: 49
Text Input Box

Background statement:
the code sub below will be part of Mark's code in post 29547, of 8-26-10, which is VB 6, so it must work with that code without conflicts.

Z is a numeric variable which will be changed several times during each session.

Private Sub Command1_Click()
Dim z as Integer
z = Text1.Text
Form1.Print "Your new z value is = " z
End Sub

The one Question is:
Does the size and position of this text input box need to be set up first (and if so need sample code.)

La Vesey
Post #29619
Posted 9/7/2010 3:44:05 PM


Forum God

Forum GodForum GodForum GodForum GodForum GodForum GodForum GodForum God

Group: Forum Members
Last Login: 12/4/2011 11:46:01 PM
Posts: 545, Visits: 2,544
No, and your code would be better written like this. The Val() function returns only the numerical portion of a string but it also instructs VB to explicitly treat the return value as numeric.


Option Explicit

Private Sub Command1_Click()
   Dim intZ As Integer
   intZ = Val(Text1.Text)
   Form1.Print "Your new intZ value is = "; intZ
End Sub




________________________________________________________________ 

"So much to learn. So little time to do it. Wise men know it's later than one thinks"!

Mark's Syntax.Zip    Pause Sub

I don't answer programming questions via PMs. That's what the forum is for! 

Post #29620
Posted 10/12/2011 10:30:41 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 10/12/2011 10:48:21 AM
Posts: 3, Visits: 5
i want to practice also how to create something special of vb.net

Post #30774
Posted 10/12/2011 7:03:19 PM


Forum God

Forum GodForum GodForum GodForum GodForum GodForum GodForum GodForum God

Group: Forum Members
Last Login: 12/4/2011 11:46:01 PM
Posts: 545, Visits: 2,544
silverfunk (10/12/2011)
i want to practice also how to create something special of vb.net

Then I suggest that you start by posting in the NET section of the forum.

________________________________________________________________ 

"So much to learn. So little time to do it. Wise men know it's later than one thinks"!

Mark's Syntax.Zip    Pause Sub

I don't answer programming questions via PMs. That's what the forum is for! 

Post #30776
« Prev Topic | Next Topic »

30 posts, Page 3 of 3. «««123

Reading This TopicExpand / Collapse
Active Users: 1 (1 guest, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Admin, Mod, Mark, Keithuk

PermissionsExpand / Collapse

All times are GMT -5:00, Time now is 2:47pm