Jump to content

c0d3r

Members
  • Content Count

    122
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by c0d3r

  1. Hi, For the last couple of days I tried figure out the issue about Canvas.Polygon wasn't working properly. Here is my routine: procedure DrawTriangle(ACanvas: TCanvas; AColor: TColor; ARect: TRect); begin ACanvas.Brush.Style := bsSolid; ACanvas.Brush.Color := ColorToRGB(clRed); //ColorToRGB(AColor); ACanvas.Pen.Color := ColorToRGB(clRed); //ColorToRGB(AColor); //ACanvas.Pen.Mode := pmCopy; ACanvas.Polygon([Point(ARect.Right - 1, ARect.Bottom - 10), Point(ARect.Right - 1, ARect.Bottom - 1), Point(ARect.Right - 10, ARect.Bottom - 1)]); end; if I passed clRed as one of the Color parameter on the red background, it drawed a white triangle, as you see from the below screenshot,. It was only painted right at the most right column. Even I hard coded to set color to clRed, it still drawed a white triangle. I just can't figure out what I was doing wrong.
  2. c0d3r

    Issue about calling Canvas.Polygon

    Solved the issue, but I don't understand the reason why, I had like: SaveIndex := SaveDC(Canvas.Handle); try IntersectClipRect(Canvas.Handle, .....); PaintRows(Canvas, ...); finally RestoreDC(Canvas.Handle, SaveIndex); end; The codes in procedure PaintRows: SaveIndex2 := SaveDC(ACanvas.Handle); try IntersectClipRect(ACanvas.Handle, .....); ..... PaintCells(ACanvas, ...); ...... finally RestoreDC(ACanvas.Handle, SaveIndex2); end; By removing the SaveDC/RestoreDC from procedure PaintRows, it solves, but Why? can't nest call SaveDC/RestoreDC??
  3. c0d3r

    Issue about calling Canvas.Polygon

    Tried reversing the order of pen and brush assignments, doesn't work either.
  4. c0d3r

    Issue about calling Canvas.Polygon

    @Anders Melander tried yours but still the same issue: procedure DrawTriangle(ACanvas: TCanvas; AColor: TColor; ARect: TRect); var SaveIndex: Integer; begin ACanvas.Lock; try SaveIndex := SaveDC(ACanvas.Handle); try ACanvas.Brush.Style := bsSolid; ACanvas.Brush.Color := clBlack; ACanvas.Pen.Color := clBlack; ACanvas.Polygon([Point(ARect.Right - 1, ARect.Bottom - 10), Point(ARect.Right - 1, ARect.Bottom - 1), Point(ARect.Right - 10, ARect.Bottom - 1)]); finally RestoreDC(ACanvas.Handle, SaveIndex); end; finally ACanvas.Unlock; end; end;
  5. c0d3r

    Issue about calling Canvas.Polygon

    Tried without, it doesn't work either.
  6. c0d3r

    Issue about calling Canvas.Polygon

    if I use clBlack instead:
  7. c0d3r

    Customizing source editor

    I created a new post for my delphi ide editor themes, you may download the files from there:
  8. Some one is asking for my themes, so I thought its better to create a new post to benefit any one who like them, I called them "Nature" themes, one Nature original theme and one Nature Warm theme, you may use Delphi IDE theme editor (https://github.com/RRUZ/delphi-ide-theme-editor) to apply them: Please click Like if you enjoy it. Nature warm (based on my Nature original theme): File: c0d3r-YW-Nature-warm.theme.xml
  9. c0d3r

    My Delphi IDE Editor themes

    Nature: The brick red represents: Flowers, The green: Forest, the orange/yellow: Moon/Sun, the cream white: Clouds, the dark blue background: Deep ocean, the light green (blueish, used for comments) : Rivers. the brown white space: earth. the Sky blue brace pair highlight: The Sky. The red error lines: Fire. File: c0d3r-YW-Nature.theme.xml
  10. Just realized that the compiler error counts were always offset by 1, so where is that extra one? Are the EMBRAS... guys able to count their fingers? if not, I can teach them.
  11. can't compile the unit is not an error that should be included, its a result due to that ONE typo error in the codes. The errors should be reported exactly as whats in your codes.
  12. Create a new vcl application, drop 2 labels, and make ONE label name typo in Oncreate event. When compiling, it said there were 2 errors in the codes:
  13. c0d3r

    Customizing source editor

    Yes. I think so, from Options/User Interface/Editor/Color/Color Speedsetting dropdown
  14. c0d3r

    Customizing source editor

    Yes. I did switch between colour schemes by using Delphi IDE Theme Editor. The last scheme I posted was used more often now.
  15. c0d3r

    Customizing source editor

    I called my this IDE colour schema : Nature. the red: Flowers, the green: Forest, the orange/yellow: Moon/Sun, the cream white: Clouds, the dark blue background: Deep ocean, the light green (a bit blueish) : Rivers. the brown white space: earth. the Sky blue brace pair highlight: The Sky. The red error lines: Fire.
  16. c0d3r

    Customizing source editor

    Here is another Delphi IDE color scheme I used to use:
  17. c0d3r

    10.4.1 IDE wait/working cursor

    I had exact the same issue. See the screenshot. Its reproducible if I ctrl-shift-up to the procedure declaration section, then ctrl-shift-down back to the procedure body, then move the cursor, you would see it. However, I'm in a VM though.
  18. c0d3r

    Customizing source editor

    Original Delphi Editor
  19. c0d3r

    Customizing source editor

    I liked mine a lot with Ubuntu mono font:
  20. c0d3r

    What is the future roadmap of Graphics32 ?

    Oh, Sorry, I didn't know that. Thats great!
  21. c0d3r

    What is the future roadmap of Graphics32 ?

    Do any of you plan to have your components to support 64-bit in near future?
  22. c0d3r

    Images in High DPI, how?

    Hi, All I need some help to figure out how to make images (PNGs and BMPs, we don't use ICONs) work properly under different High DPI screen. All our VCLs used were scaled properly EXCEPT Toolbars and images. I knew toolbars have to be scaled properly based on images, so the question turns to how to get images scaled properly? Most of our images were 16x16 PNGs, few were 24x24. and few BMPs. We were using 3rd party TPngImageList to store all PNGs. Do we have to prepare different set of Images in order to make images working under different High DPI? like a set of 20x20, a set of 24x24, 28x28 32x32... Thats a LOT and would be PITA if we have to do. Any good solutions? BTW, Could be possible to have TPngImageList to be able to save selected PNG image to a file? the reason why I'm asking is because we lost some of original PNGs during migration from Delphi 2007 to Delphi 10.4
  23. c0d3r

    Images in High DPI, how?

    Found the solution and done. The result is perfect! See:
  24. c0d3r

    smooth scaling of bitmaps

    @Anders Melander Thanks so much for the help. Now not only all the images in the application wre scaling smoothly, but also all the Toolbar2000s were all scaled perfectly under different High DPIs (100%, 125%, 150%, 200%, ...). Yes, TOOLBARS are working without adding different set of images!!!
  25. c0d3r

    smooth scaling of bitmaps

    Sorry. My mistake. Its working now, have to use LoadBitmap32FromPNG(Source, 'normal_left.png'), along with ABitmap.AlphaFormat := afDefined; The reason why I'm using TImage was just for testing to see how the images scaling looks like, so I could use it for scaling my own page control tab bars:
×