Get twip color

Get twip color

Post by Joe » Wed, 14 May 2003 09:30:34



I know you can get the color of a pixel using
GetPixelColor through GDI32 but there has GOT to be a way
to get a twip color because you can pset using twips and
have different colored twips within a pixel.

I NEED THIS SO BAD!!!

 
 
 

Get twip color

Post by Mike D Sutto » Wed, 14 May 2003 17:11:29


Quote:> I know you can get the color of a pixel using
> GetPixelColor through GDI32 but there has GOT to be a way
> to get a twip color because you can pset using twips and
> have different colored twips within a pixel.

I think you're getting a little confused about how drawing works in Windows,
there's no such thing as the colour of a twip - It's a unit of measurement
rather than a picture element.  What is most likely throwing you is that the
term 'pixel' is used to describe both a unit of measurement and the smallest
element of a picture (The measurement simply means that out unit is the same
size as one pixel on the current device.)
Having got that cleared up, it should now be a lot clearer about how to get
the colour of a pixel at a certain position on a DC measured in twips,
simply convert the coordinates from twips to pixels and then get the colour
of the pixel at that point with either the Point() method or the GetPixel()
API call.
If you're working with GDI mapping modes and 'true' twips then you'll need
to use the LPtoDP() API call to perform the conversion for you, otherwise
just use the ScaleX/Y() methods of many controls or divide the coordinates
by Screen.TwipsPerPixelX/Y.
Hope this helps,

    Mike

 -- EDais --

 - Microsoft Visual Basic MVP -
WWW: Http://www20.brinkster.com/EDais/



 
 
 

1. How can I get Twip scale from the form(Twip Scale)... ?

I'd like to get Twip scale from the form(Twip Scale)...
I need mousepointer position(by twip) on the form...

As you know, API functions like GetCurPos() return the value by Pixel...

multiplies by TwipsPerPixelX and TwipsPerPixelY !!!
As you know, can't make it...   there no detail...

hmm... what am I gonna do?

help...

June

2. InDesign Question

3. *** GETTING COLOR PICKER INFO FOR COLORS ***

4. making mountains / "setting" a displacement map ...?

5. Transparent Colors with GIFs and Getting Correct Colors on Macs

6. how to reduce the num. of polygons

7. Question: Getting an exact color match with only 256 colors

8. Getting the palette color of a system color

9. Help! Converting from pixel to twip

10. Getting the right color

11. could neone help me in getting Tiff Images RGB,CMYK color formats with associated/unassociated alpha

12. Getting the color of an object in Inventor