Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

point method

Status
Not open for further replies.

jamesoc

Technical User
Joined
Feb 1, 2005
Messages
38
Location
IE
i have a piece of code that keeps giving me errors i reckon i need to subtract one from scalewidth and scale height in order to get it to loop without errors but am having trouble any ideas




dim x as single
dim y as single

for y = 0 to pic1.scaleheight
for x = 0 to pic1.scalewidth
clr pic1.point(x,y)

if clr < (127<127) then
msgbox"good"
else
msgbox"bad"
end if
next



 
I dont know much about the point method but your loop is all over the place.

You are missing Next y and Next x.

Andy
 
Have a look at faq222-2244 as it gives some simple help resources. There are also many tutorials around to get you started. Try a Google for VB6 tutorials. Amongst others you will find:

For this question, it's a bit hard to help without a better understanding of your code.
1. Does pic1 refer to a PictureBox control?

2. It's not clear what your clr statement does. Is it a Function that you have defined? If so, what does it do?

3. If it's a PictureBox, then Point returns the RGB value of the specified point. If you want to alter a point's colour, use the PSet method

4. <q>if clr < (127<127) then</q> . The expression (127<127) will always return False represented by 0. This test returns true if clr is negative

5. You are missing a Next

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top