SzakiLaci

Forum Replies Created

Viewing 20 posts - 41 through 60 (of 149 total)
  • Author
    Posts
  • in reply to: TsAlphaImageList masking error #59649
    SzakiLaci
    Participant

    Found a workaround for this:

    Drawing pictures to canvas directly…link

    in reply to: Get a pic from TsVirtualImageList #59648
    SzakiLaci
    Participant

    [SOLVED]

    This is working perfectly fine πŸ™‚

    Code:
    type
    THackVirtList = class(TsVirtualImageList);

    procedure TFrm_myForm.VSTAfterItemPaint(Sender: TBaseVirtualTree; TargetCanvas: TCanvas; Node: PVirtualNode; ItemRect: TRect);
    var
    D: PNodeData; // pointer data for VirtualStringTree node, where you store image-indexes (D.PicIndex) and other data…
    H: THackVirtList;
    begin
    if (csDestroying in Sender.ComponentState) then Exit;
    D := VST.GetNodeData(Node);
    if not Assigned(D) then Exit;

    if (D.WhatKind = fcsPictureNeeded) then begin
    H := THackVirtList(myVirt_Image_List);
    H.DoDraw(D.PicIndex, TargetCanvas, Cellrect.Left + 4, CellRect.Top + 4, 0);
    // you may do here other Canvas draw-effects too
    end
    end;

    … but the new problem is >> if not the VirtualTree is drawing and calculting the image placement >> it won't shift the text to the right place, but starting from the left.

    So it's painting text UNDER the image. 😑

    Edit3: Solution for text alignment problem:

    Code:
    procedure …BeforeCellPaint(…
    if Column = 0 then
    ContentRect.Left := 200;
    in reply to: MainMenu font size runtime no effect (skinned) #59647
    SzakiLaci
    Participant

    [attachment=9363:MenuSizeDemoExe.jpg]

    in reply to: MainMenu font size runtime no effect (skinned) #59646
    SzakiLaci
    Participant

    Created a DEMO for you:

    [attachment=9362:MenuSize.zip]

    It seems if I turn CustomFonts Off and On again >> font size is changing! But space for it does not. πŸ™

    in reply to: MainMenu font size runtime no effect (skinned) #59645
    SzakiLaci
    Participant
    'Support' wrote:

    I have sent a changed file for test by PM

    – downloaded,

    – uninstalled the whole component pack,

    – installed (rebuilded fully!)

    but it didn't made any difference! πŸ™

    Also tried to add:

    Code:
    sSkinProvider1.RepaintMenu();

    http://www.alphaskins.com/afaq.php#T2

    If I set MenuSupport.CustomFont > False;

    it is loosing the design-time setting too! (And reverting to default size=8; style=[];

    … while during runtime step-by-step debugging reports the opposite!

    Code:
    sSkinManager1.MenuSupport.Font.Size := 20;
    sSkinManager1.MenuSupport.Font.Style := [fsBold, fsItalic];
    in reply to: Get a pic from TsVirtualImageList #59643
    SzakiLaci
    Participant

    I've found a “ready to use” method:

    Code:
    TsVirtualImageList.DoDraw(Index: Integer; Canvas: TCanvas; X, Y: Integer; …);

    Why isn't that good? It seems to me it can:

    – search for already cached bitmap

    – handle Style

    etc…

    Basically I just need a “Hacked” class of it, because it's protected … but otherwise is it OK to use?

    in reply to: Get a pic from TsVirtualImageList #59639
    SzakiLaci
    Participant
    'Support' wrote:

    function GetBitmap32(Index: Integer; Image: TBitmap; GlyphHeight: integer = 0): Boolean; // Copy an image to existing bitmap

    function CreateBitmap32(Index: Integer): TBitmap;

    Thanks for the quick answer! πŸ™‚

    So basically there is no “direct” function for this (yet?),

    the only way is to create a temporary bitmap >> draw it to Canvas from there >> destroy the bitmap?

    This seems to me a waste of CPU resources, doing the same work twice. Isn't it?

    TargetCanvas.Handle is a HDC. Isn't it possible to do something like you do while painting to a sBitBtn?

    (Actually I was trying to decypher what is happening at sVclUtils.PaintControls … )

    My guess is that the magic happens at line: 2971

    Code:
    BitBlt(DC, Left + Offset.X, Top + Offset.Y, Width, Height, MemDC, Left, Top, SRCCOPY);

    but I'm not sure, and can not figure out: where you get the source HDC from?

    ________________________________

    I've spent 6 hours so far with:

    – reading all the FAQ

    – reading all Tricks from this topics

    – searching through troubleshooting topics

    – analyzing your code.

    I remember a few years ago somebody asked this once already but could not find that topic any more.

    in reply to: skip debuging procedure or function alphacontrols #59634
    SzakiLaci
    Participant
    'chemirikmohamed' wrote:

    Wello world, For debugging how to avoid entering procedures alphacontrols functions. Deboger just the procedures and functions that we program are mandatory to pass in the own procedures of alphacontrols. Thank you.

    I always put +1 line (compiler debugging directive) into then sDefs.inc file:

    Code:
    {$D-}

    and rebuild my project. (Project >> Build … )

    Whenever you want to allow debugging again >> simply change it to D+:

    Code:
    { —- Definitions by Serge V. Goncharov —- }
    {$D+}
    {$DEFINE ACDPIAWARE} // Comment this line if support of DPI-aware mode is not

    Serge: you may put this trick to FAQ too.

    in reply to: Diagonal lines #59633
    SzakiLaci
    Participant
    'Support' wrote:

    You can use the acgpDrawLine procedure which is declared in the acgpUtils unit:

    Code:
    procedure acgpDrawLine (DC: hdc; X1, Y1, X2, Y2: Single; Color: TColor; PenWidth: Single = 1);

    This procedure paints antialiased lines.

    Hi,

    Is there any version of this that is drawing this line with alpha-channel blended? [TColor >> TsColor]

    I would like to draw a big RED diagonal line on “deleted” ikons with white “shadow”.

    Or is it faster if I pre-create this image and simply “overdraw” the original (=merge it) every time?

    (If yes >> how?)

    in reply to: MainMenu font size runtime no effect (skinned) #59632
    SzakiLaci
    Participant
    'Support' wrote:

    Technically, size of font may be changed easily, but items looks very strange if size of item is still small, but font is huge. That's what I meant.

    I can send you the changed unit and you can test it, if you wish.

    Dear Serge, πŸ™‚

    I don't know what you mean by “size of the item”, but I know 3 things:

    – customers are calling and complaining to me about “why did I changed the fonts of the menu so small”. πŸ™

    – it worked fine before (at ca. 2 year older AC version)

    – if something “looks strange”, that's an opinion, but if nobody can read a text on a FullHD monitor,

    because this component is overriding my setting if I turn it ON:

    That IS a PROBLEM.

    So, until there is no better alternative to replace the TMainMenu > it would be nice, it would WORK as it did before.

    (By painting with a size we set, overlaying the window border/title.)

    Here is a 3th proof, that it looked perfectly fine in 2015:

    [attachment=9360:skin_bor.png]

    … and, as I've stated before >> it looks great too, if I turn OFF the skin. (See prev. picture.)

    in reply to: TsAlphaImageList masking error #59622
    SzakiLaci
    Participant

    – Yes, it seems to be the same issue. :a1:

    – It appears, VirtualTree does not supports properly 8-bit alpha channels at all.

    – But how can it be, that there was no such problems with version with AC v14.19 ?

    – Can you recommend a line of code that circumvents the problem?

    (I'm thinking about: overriding VTV's paint procedure by calling YOURS!)

    Code:
    procedure TBaseVirtualTree.PaintImage(var PaintInfo: TVTPaintInfo; ImageInfoIndex: TVTImageInfoIndex; DoOverlay: Boolean);
    begin
    … ? >> calling AlphaSkin's TsVirtualImageList's draw method
    Exit;

    or… instead of modifying the source of it > I could disallow the component to draw the images, and use OnAfterItemPaint:

    Code:
    procedure TForm1.VSTAfterItemPaint(Sender: TBaseVirtualTree; TargetCanvas: TCanvas; Node: PVirtualNode; ItemRect: TRect);
    begin
    // ???
    end;

    (It would be a “nice” method, but would make step-by-step code debugging nearly impossible. )

    in reply to: MainMenu font size runtime no effect (skinned) #59621
    SzakiLaci
    Participant
    'Support' wrote:

    … But size of font in the main menu line can't be big, because size of menu items is controlled by Windows system and can't be scaled, unfortunately.

    I have no idea how to change sizes of these items, because it's handled by API.

    As you can see on the 2th picture, yes, it CAN be changed, if non-skinned, both design at runtime!

    And YES, it can be changed if skinned at DESIGN time!

    Here is the proof: (size=8>>20 + fsBold)

    [attachment=9359:Size20_Bold_designTime.jpg]

    Only the 4th case is not working currently: skinned + runtime.

    So it CAN BE DONE! There is only a BUG that prevents to change it during runtime, while skinned.

    Yes, the size of the menu-height is the only thing that can NOT be changed, but that's ok.

    If you can make the font draw on top of the upper window-frame over it, that's perfectly fine.

    (on the picture the first menu word: MUVELETEK should appear as MΕ°VELETEK)

    At old versions it has worked this way. That means you must have changed something, that broke it.

    in reply to: TsCheckBox scaleBy() problem – still not Solved #59607
    SzakiLaci
    Participant

    Prepared a demo to test with:

    [attachment=9345:CheckBoxScale.zip]

    As you can see > the problem occures only if:

    – [fsBold]

    – Skinned=false;

    – AutoSize=true;

    So the version 14.26 is better, but still not fully OK.

    – are you maybe using round() at calculating the needed space but div/trunc() at wordwrap ?

    – or maybe not setting style during pre-calc? ( [fsBold] … takes more space ! )

    [attachment=9344:sCheckBox_too_long_autoSize2.jpg]

    in reply to: TsCheckBox scaleBy() problem – still not Solved #59605
    SzakiLaci
    Participant

    This is a duplicate topic of the other

    Same problem still exists after 6 years (at v14.26) .

    LΓ‘szlΓ³

    PS: why did you delete those pictures from your server?

    in reply to: sCheckBox AutoSize – too much space #59604
    SzakiLaci
    Participant
    'Support' wrote:

    Autosizing of checkboxes will be improved in the nearest release.

    I've just realized this old topic of mine decribes the WordWrap problem much better: Link

    Also created a Demo app to test with.

    You may CLOSE this topic.

    in reply to: MainMenu font size runtime no effect (skinned) #59603
    SzakiLaci
    Participant
    'Support' wrote:

    This issue was solved in the v14.26, please check it.

    Upgraded to latest vesrion, as you've recommended. (v14.26)

    But it did NOT help.

    [attachment=9341:SkinnedMainMenu_minimalFontChange.png]

    On this picture the default size=8 Font has been set at runtime to:

    Code:
    Size:=20;
    Style:=[Bold,Italic];
    ScaleBy(180,100); // 180%

    As you can see it is painting with ca. size=9 , non-bold, non-italic

    (Non-skinned still works nicely.)

    Also tried to set “CustomFont := True” at design time >> no effect

    Basically: whatever I do at runtime, it does not have ANY effect on the font set at design time.

    in reply to: non-skinned TMainMenu ikon size of TsVirtualImageList #59580
    SzakiLaci
    Participant

    PS: it would be great, if topics could be marked as “solved”.

    Or at least edit the title to … [solved]

    ?

    in reply to: non-skinned TMainMenu ikon size of TsVirtualImageList #59579
    SzakiLaci
    Participant
    'Support' wrote:

    Try this code after a virtualimagelist size changing:

    Code:
    sMenuPicsVirtList.Loaded;

    Cool !!! Thank you VERY VERY much πŸ˜€

    It has worked perfecly fine. (Never would have guest it on my own…)

    :a3:

    in reply to: non-skinned TMainMenu ikon size of TsVirtualImageList #59577
    SzakiLaci
    Participant
    'Support' wrote:

    Hello!

    Could you make a demo, please? I'm trying to make something similar but without success..

    Thanks for the quick reply!

    What do you mean by “without success”?

    – is it not increasing the font?

    – or increasing fine and can not reproduce the problem?

    (creating proper demo takes lots of time, but I will make one, if no other possiblity…)

    Working still under Delphi7.

    in reply to: How to add a TBitmap32 image to TsAlphaImageList? #58782
    SzakiLaci
    Participant
    'Support' wrote:

    Hello

    You tried the 'Add' method already? Mask parameter may be empty there.

    Alpha channel of bitmap will not be lost.

    No, I haven't tried it πŸ˜€ … because I knew this would happen if I try to compile:

    Code:
    [Error] Konstansok.pas(3670): Incompatible types: 'TBitmap' and 'TBitmap32'

    PS: Thanks for the quick responce.

Viewing 20 posts - 41 through 60 (of 149 total)