473,387 Members | 1,597 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to do the opposite of PSet in VB

1
I am a casual VB programmer, using VB5.

I know that to set a specific pixel at X,Y on Form1 to red, I simply need to use the following:

Expand|Select|Wrap|Line Numbers
  1. Form1.PSet (X,Y), RGB(255, 0, 0)
  2.  
But, what if I have set the Picture property of Form1 to a .jpg file at design time, and then at run time, I wish to know the Red, Green, and Blue composition of a specific pixel on Form1? Thanks for any help, even if it's just a confirmation of my fears: "There is no opposite to PSet in VB5. You will have to instead write code to break down the .jpg"
Mar 11 '07 #1
1 1946
Killer42
8,435 Expert 8TB
I think what you are referring to as the "opposite" of Pset is in fact the Point property. However, this will return a single Long value. You will need to break it down into R, G and B components. That's is not difficult though.

Where it does get slightly more complex is when the colour is a system colour number (Eg. "button face") rather than an RGB value. There is a straightforward routine to detect and convert this, but I don't recall the details. Just be aware of it - you should be able to find it with a search on TSDN or the wider web if and when you need it.

Note also, you may get unexpected results depending on the AutoRedraw setting.
Mar 12 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: daimler | last post by:
help!!!!!!!! i did a for i=1 to picture1.scaleheight/2 picture1.pset (i,i) next i and the pset is shown on the picture
5
by: C. Alexander | last post by:
I'm trying to create a multi-user interactive whiteboard that has the ability to load a 'background' image to draw ontop of. The client/server needs to load a transparent layer for each user...
5
by: C. Alexander | last post by:
I'm making a 'whiteboard' application. I'm trying to have 2+ connected users able to draw at the same time. However, if User1 draws a line, when User2 is drawing, on User1 screen, it will draw...
22
by: achrist | last post by:
The yield statement looks to be a big step toward some kind of lightweight concurrency-oriented programming in python. Is there any similarly nice way to do the opposite of yield, just sit around...
2
by: Jim McGivney | last post by:
In VB6 I used the Point method to return the color of a pixel and the Pset method to change the color of a pixel. How do I accomplish the equilivant in C# ? Thanks in advance for your help. Jim
5
by: Tony | last post by:
Hi, I am looking for the opposite of wm_close, I assume it's possibly wm_open but no info comes up with that term. so, what is the opposite of WM_Close Any ideas welcome Tony
4
by: pcnerd | last post by:
I've been playing with "classic" VB since version 3. I have VB6 Learning Edition. Recently, I wanted to try VB.NET. I got a beginner's book with a CD with the software & installed it. There are...
9
by: pranav.choudhary | last post by:
Hi I am new to python. I wanted to know if there is an opposite of "import"
11
by: igor.tatarinov | last post by:
Given a bunch of arrays, if I want to create tuples, there is zip(arrays). What if I want to do the opposite: break a tuple up and append the values to given arrays: map(append, arrays, tupl)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.