Activity for Image32

  • Angus Johnson Angus Johnson committed [f90219]

    Renamed Img32.Clipper to Img32.Clipper2 to rectify issues with XE4 compiler.

  • Angus Johnson Angus Johnson posted a comment on ticket #24

    Evidently XE4 mis-handles the file naming namespaces which is surprising as both older and newer compilersdon't have this problem. I'm not keen on renaming Clipper.pas so I'll probably rename Img32.Clipper.pas to Img32.Clipper2.pas.

  • Edwin Yip Edwin Yip posted a comment on ticket #24

    Hi Angus, Now I'm getting "[dcc32 Fatal Error] Img32.Clipper.pas(50): F2092 Program or unit 'Img32.Clipper' recursively uses itself", because in the implementation 'Clipper' is still in the use list. If I remove it, I'll be getting "[dcc32 Error] Img32.Clipper.pas(88): E2242 'InflatePaths' is not the name of a unit" error. I guess the solution might be what I suggested above - rename '\Clipper\Clipper.pas' as something like 'Clipper.Common.pas'?

  • Angus Johnson Angus Johnson posted a comment on ticket #24

    OK, I've once again amended Img32.Clipper. Hopefully it'll compile for you this time. 🤞

  • Angus Johnson Angus Johnson committed [c17579]

    Fixed bug compiling Img32.Clipper (#24)

  • Edwin Yip Edwin Yip posted a comment on ticket #24

    @angusj, thanks for the new version! My XE4 is still getting: [dcc32 Fatal Error] Img32.Clipper.pas(16): F2092 Program or unit 'Img32.Clipper' recursively uses itself

  • Angus Johnson Angus Johnson posted a comment on ticket #24

    I'm confident I've found and fixed the problem you were encountering. A couple of the Clipper library source files had acquired unicode byte marks which I've now removed. I've also rechecked pretty much everything including the samples and it compiles without issues for me in both Delphi 7 and Delphi 10.4

  • Angus Johnson Angus Johnson committed [a9253e]

    Fixed problem with unicode byte marks in source

  • Angus Johnson Angus Johnson committed [d6efb5]

    Added compiler directive to optionally disable storage streams

  • Angus Johnson Angus Johnson posted a comment on ticket #24

    Hi Edwin. Yes, Clipper has recently undergone massive change and I'm now in the process of rechecking its integration into Img32.

  • Angus Johnson Angus Johnson committed [ea2f6d]

    Updated Clipper library

  • Edwin Yip Edwin Yip created ticket #24

    Compiling with XE4

  • Angus Johnson Angus Johnson posted a comment on ticket #22

    Sorry, I missed your earlier comment re BMP file headers. Yes TImageFormat_BMP.SaveToStream intentionally omits the file header because they are only required when saving to file streams, and the TImageFormat_BMP.SaveToFile function does include the file header. However, when saving to other streams, eg BMP resource streams, the file header is not required and can cause problems. If you really need the file header in a 'non-file' stream, then you'll need to manually copy the header into the stream...

  • Hafedh TRIMECHE Hafedh TRIMECHE posted a comment on ticket #22

    Dear Jhonson, Thank you for your prompt response. The Bitmap still exported without BMP File Header. This function would resolve the problem: function TImage32.ToBitmap:TBitmap; begin Result := TBitmap.Create; Result.Width := Width; Result.Height := Width; Result.PixelFormat := pf24bit; CopyToDc(Result.Canvas.Handle); end; Best regards.

  • Angus Johnson Angus Johnson modified ticket #22

    BMP & GIF problem

  • Angus Johnson Angus Johnson committed [1b52c5]

    Img32.Fmt.Gif

  • Angus Johnson Angus Johnson modified ticket #21

    Top spacing seems too big

  • Angus Johnson Angus Johnson modified ticket #20

    Text overflows bounding rect

  • Angus Johnson Angus Johnson modified ticket #19

    Experimental Img32.Ctrls demo don't work on French Windows

  • Angus Johnson Angus Johnson modified ticket #18

    Compile fatal error on BDS2006

  • Angus Johnson Angus Johnson modified ticket #23

    AV in the depths of Img32 modules.

  • Angus Johnson Angus Johnson modified a comment on ticket #23

    Hi Vad. This is your problem .... FontReader.Load('Courier'); This isn't a TrueType font and Image32 only reads TrueType fonts. Change the line to ... FontReader.Load('Courier New'); and your chart will look just fine.

  • Angus Johnson Angus Johnson posted a comment on ticket #23

    Hi Vad. This is your problem .... FontReader.Load('Courier'); This isn't a TrueType font and Image32 only reads these fonts. Change the line to ... FontReader.Load('Courier New'); and your chart will look just fine.

  • Vad Vad posted a comment on ticket #23

    But still there is one remark. If you draw the text in clBlack color, then it is not visible. See attachment.

  • Vad Vad posted a comment on ticket #23

    Ooops... my bad, sorry! :( I forgot about the -1 in the code: for var i := 0 to Length(ph.prices) - 1 do begin Night is the mother of counsels :)

  • Vad Vad posted a comment on ticket #23

    Delphi 10.4.2 Pro + Win 10 x64 + latest Img32 snapshot

  • Vad Vad created ticket #23

    AV in the depths of Img32 modules.

  • Angus Johnson Angus Johnson posted a comment on ticket #22

    Hi Hafedh. Thanks for the feedback, and I've verified that that this is indeed a bug. Hopefully this will work ... procedure TImageFormat_GIF.SaveToStream(stream: TStream; img32: TImage32); var gif: TGIFImage; bmp: TBitmap; begin bmp := TBitmap.Create; gif := TGIFImage.Create; try //copy to the new TBitmap bmp.PixelFormat := pf32bit; bmp.SetSize(img32.Width, img32.Height); bmp.AlphaFormat := afDefined; SetBitmapBits(bmp.Handle, img32.Width * img32.Height * 4, img32.PixelBase); //next copy from the...

  • Hafedh TRIMECHE Hafedh TRIMECHE created ticket #22

    BMP & GIF problem

  • Angus Johnson Angus Johnson committed [4788d5]

    Clipper library updated (Img32 dependency)

  • Angus Johnson Angus Johnson committed [5c7a3c]

    Minor edit

  • Angus Johnson Angus Johnson committed [18f2d4]

    Img32

  • Angus Johnson Angus Johnson modified a comment on discussion General Discussion

    Hi again Daniel. Firstly, I'm happy to hear zooming is working for you. 👍 Using ClearType inside TSvgReader isn't feasible. ClearType is only of (limited) value when drawing text over solid colors, typically a white background. In theory it can also be done over colored and even patterned backgrounds, but it's debatable if anyone would find the text any clearer. And I really can't envisage a way to do this in SVG in a time efficient manner, and one that would justify the considerable effort. ps:...

  • Angus Johnson Angus Johnson modified a comment on discussion General Discussion

    Hi again Daniel. Firstly, I'm happy to hear zooming is working for you. 👍 Using ClearType inside TSvgReader isn't feasible. ClearType is only of (limited) value when drawing text over solid colors, typically a white background. In theory it can also be done over colored and even patterned backgrounds, but it's debatable if anyone would find the text any clearer. And I really can't envisage a way to do this in SVG in a time efficient manner, and one that would justify the considerable effort.

  • Angus Johnson Angus Johnson posted a comment on discussion General Discussion

    Hi again Daniel. Firstly, I'm happy to hear zooming is working for you. 👍 Using ClearType inside TSvgReader isn't feasible. ClearType only works when drawing text over a solid color, typically a white background. And I really can't envisage a way to do this in SVG since there's no sensible (time efficient) way to determine text backgrounds.

  • Daniel Zvinca Daniel Zvinca posted a comment on discussion General Discussion

    Hi Angus, High quality zoom for SVG worked. Thanks for the SVG.Reader tip! I have just one extra question. Is it any way I can control the Text rendering of the SVG, to maybe use the mentioned cleartype for standard screen resolution? It looks quite pixelated for regular font and better for larger font. Thanks!

  • Angus Johnson Angus Johnson posted a comment on discussion General Discussion

    Stretching the current rendered image while zooming (see svg application), while certainly faster is not sharp, Indeed. That's because the stretching is done by pixel interpolation (resampling) rather than by vector scaling and re-rendering (ie rasterizing). this process can benefit from a total reload of the vectorial information of a SVG (slower) Actually, it may be quite a bit quicker because raster scaling isn't very fast (unless using a very inferior resampler - eg nearest neighbor). And the...

  • Daniel Zvinca Daniel Zvinca posted a comment on discussion General Discussion

    Hi Angus, Thank you so much for your detailed answer. While in the mean while I sort of figured where the vectorial part ends and where the rasterization starts, and the fact the Image32 does not store the primitives information but only the last rasterized stage after each Draw task, I am still wondering how to make use of the vectorial information of a SVG in the provided panel control, enhancing the precision while zooming in. Stretching the current rendered image while zooming (see svg application),...

  • Angus Johnson Angus Johnson modified a comment on discussion General Discussion

    HI Daniel. Thank you for your very encouraging feedback I was looking into the SVG application, which compiled just fine, but I didn't figure how to use the vectorial scaling advantage when the loaded image is a SVG in TImage32Panel. The idea is to scale the vector image before rendering it, and this is easily managed by setting the image's size before loading the image from file. This may seem strange since we're all so used to loading raster images using their fixed dimensions and then scaling...

  • Angus Johnson Angus Johnson modified a comment on discussion General Discussion

    HI Daniel. Thank you for your very encouraging feedback I was looking into the SVG application, which compiled just fine, but I didn't figure how to use the vectorial scaling advantage when the loaded image is a SVG in TImage32Panel. The idea is to scale the vector image before rendering it, and this is easily managed by setting the image's size before loading the image from file. This may seem strange since we're all so used to loading raster images using their fixed dimensions and then scaling...

  • Angus Johnson Angus Johnson posted a comment on discussion General Discussion

    HI Daniel. Thank you for your very encouraging feedback I was looking into the SVG application, which compiled just fine, but I didn't figure how to use the vectorial scaling advantage when the loaded image is a SVG in TImage32Panel. The idea is to scale the vector image before rendering it, and this is easily managed by setting the image's size before loading the image from file. This may seem strange since we're all so used to loading raster images using their fixed dimensions and then scaling...

  • Daniel Zvinca Daniel Zvinca posted a comment on discussion General Discussion

    Hi Angus, This is a lovely piece of software. I just found out about just by accident and I truly like it so far. I was looking into the SVG application, which compiled just fine, but I didn't figure how to use the vectorial scaling advantage when the loaded image is a SVG in TImage32Panel. Is it any way of preserving the vectorial format by drawing into a DC using GDIPlus ? (I know is ancient, but some PDF libraries are happy when is provided a EMF which can also store GDIPLUS records). If not,...

  • Angus Johnson Angus Johnson committed [baa815]

    Img32.Vector

  • Angus Johnson Angus Johnson committed [989a03]

    Img32.Vector

  • Angus Johnson Angus Johnson committed [9b9be3]

    Minor bugfix in Img32.Layers

  • Angus Johnson Angus Johnson committed [1475e5]

    Fixed compatibility issues with older versions of Delphi.

  • Image32 Image32 released /image32_4.1.zip

  • Image32 Image32 updated /ReadMe.txt

  • Angus Johnson Angus Johnson committed [38d011]

    Fixed bug in Grow function introduced in a recent upload.

  • Angus Johnson Angus Johnson committed [401085]

    Img32.Layers

  • Image32 Image32 released /image32_4.0.zip

  • Image32 Image32 updated /ReadMe.txt

  • Angus Johnson Angus Johnson committed [c58ed6]

    Version 4.0 (final)

  • Angus Johnson Angus Johnson committed [925ef4]

    Img32.Text

  • Angus Johnson Angus Johnson posted a comment on ticket #21

    You can draw text onto an opaque bitmap and fairly easily copy that text with the opaque background into a TImage32 object. When doing so however (eg using Windows.GetBitmapBits) you'll also need to manually set the alpha channel to 255 (because the GDI leaves the alpha channel completely untouched). That's pretty easy to do using TImage32.SetAlpha. Alternatively, you could use TImage32.CopyFromDC passing the bitmaps' canvas handle but that just hides quite a bit of unnecessary work. If you really...

  • Pierre Y. Pierre Y. posted a comment on ticket #21

    Hi Angus, Thank you for taking time to help me. As I only target Windows devices... And I want to keep Segoe UI... Could it be possible to use the Windows Text rendering functions to render the text on a 32 bits bitmap (for antialiasing and alpha transparency) and then copy this image at the right place on the final TImage32 ? -- Pierre

  • Angus Johnson Angus Johnson posted a comment on ticket #21

    Firstly, part of the problem (if it is a problem) is the Segoe UI font seems to have a relatively large ascent (the space between the test baseline and the very top of the tallest text including diacritics - eg Ñ) compared to other fonts. Having said that, text in Image32 is generally positioned relative to the text's baseline. So, when positioning text relative to its top, it's up to you as the user to decide between using the TFontCache's Ascent property or using Img32.Vector.GetBounds to get the...

  • Pierre Y. Pierre Y. posted a comment on ticket #21

    As an example, in the attached image, the "button" on the left is rendered using TImage32, the one on the right is rendered using Windows GDI. What's... fun is that "Top" alignment places the text lower than "Bottom" alignment.

  • Pierre Y. Pierre Y. created ticket #21

    Top spacing seems too big

  • Pierre Y. Pierre Y. posted a comment on ticket #20

    Can't believe it was so simple :) Thank you very much Angus.

  • Angus Johnson Angus Johnson posted a comment on ticket #20

    Hi Pierre. First, I'm delighted you're finding Image32 so useful. I can see you're using the latest code in the repository and you have indeed found a bug there. To fix it ... in the method TFontCache.GetTextOutline in Img32.Text about line 2380 you'll find the following block of code ... for i := startLine to endLine do begin a := tpm.wordListOffsets[i]; b := tpm.wordListOffsets[i+1] -1; //replace the following line //spcDx := tpm.justifyDeltas[i]; //with this ... if textAlign = taJustify then spcDx...

  • Pierre Y. Pierre Y. created ticket #20

    Text overflows bounding rect

  • Angus Johnson Angus Johnson modified ticket #17

    Missing color name lightgrey

  • Angus Johnson Angus Johnson posted a comment on ticket #19

    FormatSettings.DecimalSeparator := '.'; Thanks. Yes, that definitely needs fixing.

  • Pierre Y. Pierre Y. created ticket #19

    Experimental Img32.Ctrls demo don't work on French Windows

  • Pierre Y. Pierre Y. posted a comment on discussion General Discussion

    Hi, I'm using a TSpeedButton clone I built ages ago. I don't want it to be "theme aware" since what I really want is to be able to choose all the colors of that button and tweak the Image/Text layout (for example, to be able to "stretch" the image on the button background (preserving transparency) and draw the text on top of it. Now, I would like to improve that button a bit and have it corner rounded wih pixel perfect rendering. And that brings a LOT of questions in regards to clipping the image...

  • Angus Johnson Angus Johnson modified a comment on discussion General Discussion

    Thanks for getting back and for all your help. You're welcome. What if I just wanted to clip a simple rectangular area, image.FillRect(rec, clNone32); in the last few days I wrote a simple plotting component Looks good. Also, there's a new InterpolatePoints function in Img32.Extra (line 2822ff) that you might find useful though it hasn't quite made it to the release package. (Note also the precondition comments in the interface section.)

  • Angus Johnson Angus Johnson modified a comment on discussion General Discussion

    Thanks for getting back and for all your help. You're welcome. What if I just wanted to clip a simple rectangular area, image.FillRect(rec, clNone32); in the last few days I wrote a simple plotting component Looks good. Also, there's a new InterpolatePoints function in Img32.Extra (line 2822ff) that you might find useful though it hasn't quite made it to the release package.

  • Angus Johnson Angus Johnson posted a comment on discussion General Discussion

    Thanks for getting back and for all your help. You're welcome. What if I just wanted to clip a simple rectangular area, image.FillRect(rec, clNone32); in the last few days I wrote a simple plotting component Looks good. Also, there's a new InterpolatePoints function in Img32.Extra that you might find useful though it hasn't quite made it to the release package (line 2822ff).

  • Herbert M Sauro Herbert M Sauro posted a comment on discussion General Discussion

    Thanks for getting back and for all your help. What if I just wanted to clip a simple rectangular area, would I use ErasePolygon? I'm currently using my own clipping code to clip lines which works so far. I wanted to try out TImage32 instead of using GDI+ which I've used in the past. So far, its worked out quite well. As an experiment, in the last few days I wrote a simple plotting component . It doesn't use a lot of the TImage32 API but enough for my purpose. I'm put the code up on GitHub once it's...

  • Angus Johnson Angus Johnson modified a comment on discussion General Discussion

    Hi again Herbert. There are a couple of ways to clip an image (assuming you're not just clipping a simple rectangular region). If you're performing a single (once only) clip operation with a given polygon shape then the Img32.Draw.ErasePolygon procedure is probably the simplest (and likely the most efficient too). But if your clip polygon is likely to be used more than once then create a clip image mask and use TImage32's CopyBlend function passing Img32.BlendMask as the blend function. (You can...

  • Angus Johnson Angus Johnson posted a comment on discussion General Discussion

    Hi again Herbert. There are a couple of ways to clip an image (assuming you're not just clipping a simple rectangular region). If you're performing a single (once only) clip operation with a given polygon shape then the Img32.Draw.ErasePolygon procedure is probably the simplest (and likely the most efficient too). But if your clip polygon is likely to be used more than once then create an image mask and use TImage32's CopyBlend function passing Img32.BlendMask as the blend function. (You can see...

  • Herbert M Sauro Herbert M Sauro modified a comment on discussion General Discussion

    Are there any functions to clip drawing operations to a given 2D area? I have my own clipping method I wrote ages ago which I can use but I wanted to ask if there is anything built into TIMage32? I searched the API docs but nothing turned up.

  • Herbert M Sauro Herbert M Sauro posted a comment on discussion General Discussion

    Are there any functions to clip drawing operations to a given 2D area? I have my own clipping method I wrote ages ago which I can use but I wanted to ask if there is anything built into TIMage32? I search the API docs but nothing turn up.

  • Angus Johnson Angus Johnson modified a comment on discussion General Discussion

    I assume to draw an empty circle with an outline I would use code such as: path := Circle(pt, 5); DrawLine (img, path, 2, OutlineColor, esRound); Almost right. path := Circle(pt, 5); DrawLine (img, path, 2, OutlineColor, esPolygon); Same with your fill + outline. Edit: In the next packaged release (and already in the code repository) you could use esClosed instead of esPolygon.

  • Angus Johnson Angus Johnson posted a comment on discussion General Discussion

    I assume to draw an empty circle with an outline I would use code such as: path := Circle(pt, 5); DrawLine (img, path, 2, OutlineColor, esRound); Almost right. path := Circle(pt, 5); DrawLine (img, path, 2, OutlineColor, esPolygon); Same with your fill + outline.

  • Herbert M Sauro Herbert M Sauro posted a comment on discussion General Discussion

    I just want to check that I am doing this right as I am still geting used to Image32. I want to draw a filled circle with an outline stroke or an empty circle with an outline stroke. I assume to draw an empty circle with an outline I would use code such as: path := Circle(pt, 5); DrawLine (img, path, 2, OutlineColor, esRound); And to draw a filled circle with an outline I would use code such as: path := Circle(pt, 5); DrawPolygon (img, path, frNonZero, FillColor); DrawLine(img, path, 2, OutlineColor,...

  • Angus Johnson Angus Johnson committed [1baa97]

    Minor code tidy

  • Angus Johnson Angus Johnson committed [ea6196]

    Img32.Ctrls

  • Angus Johnson Angus Johnson modified a comment on discussion General Discussion

    Without looking at my code, I suspect the problem is with the integer array that you're passing to this procedure. It's very likely that a dynamic array is expected (as opposed to an open array) and older versions of Delphi will require these to be constructed separately and passed as named variables.

  • Angus Johnson Angus Johnson posted a comment on discussion General Discussion

    Without looking at my code, I suspect the problem is with the integer array that you're passing to this method. It's very likely that a dynamic array is expected (as opposed to an open array) and older versions of Delphi will require these to be constructed separately and passed as named variables.

  • Max Evans Max Evans posted a comment on discussion General Discussion

    Hi Angus, I'm using XE6 and trying to use DrawDashedLine (from img32.draw unit), however the compiler is giving me and error of "there is no overloaded version of DrawDashedLine that can be called with these arguments" In my code, I'm declaring it as Img32.Draw.DrawDashedLine(AImage, AArc, [2, 2], nil, 2, claqua32, esPolygon); Works perfectly on XE7, but not in XE6... Any ideas ?

  • Herbert M Sauro Herbert M Sauro posted a comment on discussion General Discussion

    @Rob, I thought about that and in recent days I have played around with a simple api for generating SVG. I generally only used the most basic things like shapes, lines, colors and maybe gradients. With that its should be doable to create a separate SVG class that records the operations are it get routed to TImage32.

  • Rob Lambden Rob Lambden posted a comment on discussion General Discussion

    Hi Herbert, I have my own shape class I use which renders lines and bezier curves to an Image32. If you use something like that then it would be relatively simple to "render" that to an SVG file. I haven't done it as I have no need. If you are internally recognising that an image is vector based, and you use vector drawing commands to render it, (for example for arbitrary scaling) then you should be able to recreate the drwing instructions as an SVG file. Once the data is in a raster format then...

  • Herbert M Sauro Herbert M Sauro posted a comment on discussion General Discussion

    ok understand, once you're ready it will be handy to have it on GetIt.

  • Herbert M Sauro Herbert M Sauro posted a comment on discussion General Discussion

    Thanks, that's what I suspected.

  • Angus Johnson Angus Johnson posted a comment on discussion General Discussion

    This is something I'm considering but the library has been and still is under too much development to make this sensible just now.

  • Angus Johnson Angus Johnson posted a comment on discussion General Discussion

    Hi Herbert. Mostly no unless it's a very simple raster image (eg see the vectorize sample app). You could in theory record the image editing instructions you make and convert these into SVG instructions but that would be a huge amount of work.

  • Herbert M Sauro Herbert M Sauro posted a comment on discussion General Discussion

    Are there any plans to put TImage32 on the Delphi Getit pacakge manager?. I just came across a submission page at: https://getitnow.embarcadero.com/submit/

  • Herbert M Sauro Herbert M Sauro posted a comment on discussion General Discussion

    I've started using image32 and so far so good. I realise that its a raster based library but is there any way to export to SVG once an image has been constructed?

  • Angus Johnson Angus Johnson posted a comment on discussion General Discussion

    Thank you for the very helpful feedback. I'll make the changes you suggested. Cheers.

  • Ruchira Hasaranga Ruchira Hasaranga posted a comment on discussion General Discussion

    Just found out that the bug occur within the Img32.Fmt.JPG.pas -> LoadFromStream method. In the following line, Canvas.Handle occasionally becomes zero when called from background thread. img32.CopyFromDC(Canvas.Handle, Rect(0,0, Width, Height)); Then I realized the issue comes from the TJpegImage class. TJpegImage.Canvas.Handle occasionally becomes zero when called from a background thread. After searching more on the subject, I found following two links: https://en.delphipraxis.net/topic/1292-why-is-this-code-not-thread-safe-delphi-7/?do=findComment&comment=10765...

  • Ruchira Hasaranga Ruchira Hasaranga posted a comment on discussion General Discussion

    Hi, I just noticed when loading jpeg from a non-ui thread (task) causes it to decoded to black image randomly. Following code demonstrate the issue. This issue mostly occur when I move the mouse on the main window. procedure TForm1.DecodeTaskHandler; var myImage: TImage32; begin while True do begin myImage := TImage32.Create(); if myImage.LoadFromFile('D:\small_white_image.jpg') then begin if myImage.Pixel[0,0] = Color32(clBlack) then MessageBox(0, 'Image decode failed','Error', 0); end; myImage.Free;...

  • Bug Menot Bug Menot created ticket #18

    Compile fatal error on BDS2006

  • Angus Johnson Angus Johnson posted a comment on ticket #17

    Thanks for the feedback Mark. I'll fix and update shortly. Cheers

  • Mark Ford Mark Ford posted a comment on ticket #17

    I just wanted to mention that while Commit [e36084] does add lightgrey it duplicates the other grey colors that were already in the list and breaks the existing alphabetical order (I don't know if that's important or not, but I suspect that's why the other greys weren't noticed.)

  • Angus Johnson Angus Johnson committed [e36084]

    Img32.Controls

  • Mark Ford Mark Ford created ticket #17

    Missing color name lightgrey

  • Image32 Image32 released /image32_3.4.1.zip

  • Image32 Image32 updated /ReadMe.txt

1 >