473,404 Members | 2,174 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,404 software developers and data experts.

GETPIXEL API

ok i searched the internet for this api and i found the
usage of getpixel api like this:
getpixel(example.hdc,x,y)
but i cant find any property about this "hdc".. that does
that hdc 's equal in vb.net??? thanx for helping..
Nov 20 '05 #1
7 9755
Hi,

The graphics object has a gethdc method. You must manually release
the hdc when you are done with it.

Private Sub Form1_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint

Dim g As Graphics = e.Graphics

Dim hdc As IntPtr = g.GetHdc

' Do something with the hdc

g.ReleaseHdc(hdc)

End Sub

Ken
------------------
"Serdar C." <se*****@interaktif.gen.tr> wrote in message
news:02****************************@phx.gbl...
ok i searched the internet for this api and i found the
usage of getpixel api like this:
getpixel(example.hdc,x,y)
but i cant find any property about this "hdc".. that does
that hdc 's equal in vb.net??? thanx for helping..

Nov 20 '05 #2
I have never used the getpixelapi, but hdc normally means that it requires a
handle into the object that you are trying to manipulate.

Normall you would have to calls one to get the Windows Handle and return it
as a long and then pass that long through the call

"Serdar C." <se*****@interaktif.gen.tr> wrote in message
news:02****************************@phx.gbl...
ok i searched the internet for this api and i found the
usage of getpixel api like this:
getpixel(example.hdc,x,y)
but i cant find any property about this "hdc".. that does
that hdc 's equal in vb.net??? thanx for helping..

Nov 20 '05 #3
OK, Back again.
http://www.partware.com/ebooks/api/ref/g/getpixel.html

Shows an example for this function, and an explanation of the hdc (Handle
for a Device Context)

Hope this helps.

Alixx

"Serdar C." <se*****@interaktif.gen.tr> wrote in message
news:02****************************@phx.gbl...
ok i searched the internet for this api and i found the
usage of getpixel api like this:
getpixel(example.hdc,x,y)
but i cant find any property about this "hdc".. that does
that hdc 's equal in vb.net??? thanx for helping..

Nov 20 '05 #4
Hello,

"Serdar C." <se*****@interaktif.gen.tr> schrieb:
ok i searched the internet for this api and i found the
usage of getpixel api like this:
getpixel(example.hdc,x,y)
but i cant find any property about this "hdc".. that does
that hdc 's equal in vb.net??? thanx for helping..


If you want a hDC to the form, use this code:

\\\
Dim g As Graphics = Me.CreateGraphics()
Dim hDC As IntPtr = g.GetHdc
..
..
..
g.ReleaseHdc(hDC)
g.Dispose()
///

HTH,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet
Nov 20 '05 #5
"Serdar C." <se*****@interaktif.gen.tr> schrieb
ok i searched the internet for this api and i found the
usage of getpixel api like this:
getpixel(example.hdc,x,y)
but i cant find any property about this "hdc".. that does
that hdc 's equal in vb.net??? thanx for helping..


Pass the return value of Graphics.GetHdc. You get a graphics object in sub
OnPaint/Paint event (e.graphics) or create a new one using
MyControl.CreateGraphics. (call it's dispose method after calling getpixel)
--
Armin

Nov 20 '05 #6
Thanx So Much For Helping MY Program Is Working Now :)
ur #1!
Nov 20 '05 #7
Cor
Everybody did give an answer except the specialist the Über Geek
Nov 20 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: C. Alexander | last post by:
Hey all. I have a whiteboard type program. I have 2 picturebox's (needed for their mousemove/mousedown events) Picture1.Picture = MyPicture ' Here is my hidden picture used to replace (on...
1
by: Morten Nielsen | last post by:
Does anyone have any idea why I can't get a pixel-value of 255 returned in the code below? Any color-value from 0 up to 254 is returned correctly, but any color-component of 255 returns zero. ie....
6
by: Martin Holmgaard | last post by:
I have written the following function to be used for flood filling in a bitmap. The function works fine on Windows XP Prof and Windows 2000 server, but on Windows 2003 server it return a stack...
0
by: OHM \( One Handed Man \) | last post by:
I would like to find the colour of a specific pixel in a AxWebBrowser, can anybody offer any code for this? Son of OHM. -- ( OHM ) - One Handed Man AKA Terry Burns - http://TrainingOn.net
0
MetalMartian
by: MetalMartian | last post by:
I'm trying to write code for a game based on the original Pacman in Visual Basic .NET 2003, however I can't figure out how to make the character move around the screen and not go through the walls....
2
by: devnew | last post by:
i am trying to get the pixel data using im.getpixel() i am getting a tuple like (152,118,106) for a pixel in a RGB jpeg image . what i really want is an integer value representing a pixel ,like...
6
by: herzog | last post by:
Hi, I am using C# to a draw a graphic on a memory bitmap. I then extract the color information of every pixel of the bitmap. I do this with Bitmap.GetPixel(). The trouble I'm having is that I...
4
by: demc | last post by:
Hi there guys! Today I've spent all evening googling, msdning, codeprojecting and thescripting about problem when trying to get color of pixel somewhere in bounds of a video player form. So let...
1
by: aniketpatil | last post by:
I am trying to extract RGB value of a particular pixel on the SCREEN (NOT picture box or etc)and compare it with given color so far this is a sample code- Dim ldc As Long ldc = GetWindowDC(0) ...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.