Re: Colors -- What Am I Missing

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: dw85745 (dw85745_at_gbronline.com)
Date: 02/20/05


Date: Sun, 20 Feb 2005 10:05:23 -0500

Thanks Mr Albers. Will check into it.

Made a quick example flipping the memory DC on top of a PBox.

With a pure white background the line shows up LtBlue.

HOWEVER with a multiple colored background, (used a "fall" leaf pattern of
greens and reds) the line shows up Black.

Still don't get it why the color change -- COPY_PEN should overwrite any
pixels on the bitmap (like SetPixel).

"Thorsten Albers" <albersRE@MOVEuni-freiburg.de> wrote in message
news:01c51751$52b1c8e0$088ee684@thaldesk...
> dw85745 <dw85745@gbronline.com> schrieb im Beitrag
> <oo-dnWNUVLZyMorfRVn-pg@gbronline.com>...
> > The problem I'm having is that once the lines are "initially" placed
they
> > become part of the bitmap.
>
> An IMHO good solution to this problem is the use of the Windows API
> procedure LineDDA(). This does not draw the Line itself but calculates the
> points of the line and reports them to Your application via a
LineDDAProc()
> callback procedure.
> In the callback procedure You may decide what to do with the data:
> a) You could read the current pixel color at the point, calculate the
color
> which would make the line at this point visible resp. invisible and then
> draw the pixel
> b) You could store all points in an array; the amount of data is even with
> a diagonal line not very high; to draw line: get the pixel to draw at a
> specific point from the array, store the current pixel color there to the
> array and draw the pixel; to erase the line: get the last pixel color fr a
> specific point from the array and draw the pixel.
>
> --
> ----------------------------------------------------------------------
> THORSTEN ALBERS Universität Freiburg
> albers@
> uni-freiburg.de
> ----------------------------------------------------------------------
>



Relevant Pages

  • Re: Colors -- What Am I Missing
    ... This does not draw the Line itself but calculates the ... You could read the current pixel color at the point, ... specific point from the array, store the current pixel color there to the ...
    (microsoft.public.vb.winapi)
  • Re: Lineal skalieren
    ... Aber hat ein Pixel in diesem Array eine Fläche? ... Hat das ganze Array ... Ich sehe eine Bitmap als Bild an. ...
    (microsoft.public.de.german.entwickler.dotnet.vb)
  • Processing binary (BMP) files in gawk
    ... Then I looked at each pixel in the A array, and if it was not the ... provided they were background color. ... Then I read out the array in order and printfed it to the outfile. ...
    (comp.lang.awk)
  • Re: Lineal skalieren
    ... Das Pixel auf dem Bildschirm ist auch ... Eine Bitmap ist zunächst nichts anderes als ein zweidimensionales ... Aber hat ein Pixel in diesem Array eine Fläche? ... Digitalisierung eines Bildes eine Methode ist, ...
    (microsoft.public.de.german.entwickler.dotnet.vb)
  • Re: picture control pset performance?
    ... You asked for a faster way of performing the task, and without a knowledge of how you got your greyscale data into the byte array in the first place I cannot say how much faster you can do the job, because I cannot come to a decision regarding whether you need to get the greyscale data into the array at all, and even if you do I could probably suggest faster ways of doing it. ... in the code you posted you were running through the data in the byte array and then setting various pixels in a VB picture box using the VB Pset method. ... In that case it would appear that you want the greyscale pixel data to be manipulated and then converted into pixel data in the picture box at the current colour depth of the user's desktop, because that is what your code currently does. ... Do you just want to *display* the result or do you also want to save the resultant Picture Box image using standard VB techniques, in which case it will be saved as a 24 bit colour depth bitmap picture in which each pixel is represented by three bytes? ...
    (microsoft.public.vb.general.discussion)