Combine Color Picker & Maginifier

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #36133
    kaju_74
    Participant

    Hi.

    I'm currently trying to improve the TsMaginier to be able to pick up a color under the cursor (inside the glass form). My goal is to integrate the magnifier inside the TsColorDialog if you start to pickup a screen color. But: I don't know how to retrieve the color under the mouse coordinate inside the glass form.

    I've tryed the following:

    Code:
    procedure TacMagnForm.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
    begin
    inherited;
    TsMagnifier(Caller).FPickColor := MagnBmp.Canvas.Pixels[x, y];
    if Assigned(TsMagnifier(Caller).OnMouseDown) then
    TsMagnifier(Caller).OnMouseDown(Caller, Button, Shift, X, Y);
    if (mbLeft = Button) then
    begin
    acIsDragging := True;
    ReleaseCapture;
    Perform(WM_SYSCOMMAND, SC_DRAGMOVE, 0);
    end;
    end;

    But “MagnBmp” seems to be the wrong bitmap which contains the maginified bitmap.

    Any idea how to solve this?

    Best regards,

    Marc

    #51977
    Support
    Keymaster

    Hello

    Since v9.03 this component have the TsMagnifier.GetPixelColor function.

    This function returns a pixel color from magnifier by coords.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.