Edwin Yip 154 Posted September 16, 2021 Thanks for your continued effort in making Image32 better and better! So I want to use your svg viewer, and would like to make the following changes, and I'm wondering if you accept pull requests (or does sf.net even have a "pull request" feature?)? Change `TBaseImgPanel.fScrollbarHorz : TPanelScrollbar` from private to public, so that I can implement my own key-bindings for panning the image view. Add `OnMouseWheel` event. Make `TBaseImgPanel.ScaleAtPoint` public so that can I implement customized zooming. Basically, I want to change the way how the image's zoomed out/in and panning. Thanks! 15 hours ago, angusj said: Just updated to version 3.2 https://sourceforge.net/projects/image32/ Share this post Link to post
angusj 126 Posted September 16, 2021 (edited) 19 hours ago, Edwin Yip said: So I want to use your svg viewer, and would like to make the following changes Done. Also, there was a problem with the last update where I failed to upload a recent change in Img32.pas which caused problems in Img32.Layers. That's now fixed too. I've also made a minor update to the Layers301 sample application. https://sourceforge.net/projects/image32/files/ Edited September 17, 2021 by angusj For Edwin :) 3 Share this post Link to post
Edwin Yip 154 Posted September 17, 2021 (edited) 2 hours ago, angusj said: Done. Also, there was a problem with the last update where I failed to upload a recent change in Img32.pas which caused problems in Img32.Layers. That's now fixed too. I've also made a minor update to the Layers301 sample application. https://sourceforge.net/projects/image32/files/ Thanks Angus, I'll check it out! What a vivid colorful looking of the picture! It reminds me the early days of the web 2.0 era where all websites have such vivid colorful looking. Edited September 17, 2021 by Edwin Yip Share this post Link to post
misc_bb 7 Posted September 30, 2021 @angusj I've tried converting SVG to PNG, are text layers not included during conversion or I maybe missing something? I just followed the example code. Thank you. Share this post Link to post
angusj 126 Posted September 30, 2021 (edited) 3 hours ago, misc_bb said: I maybe missing something? Hi misc_bb. Yes, I think you are 😜. Try modifying the SVG101 sample by adding a TSaveDialog control (with filters for PNG and JPG file types). Then make sure both Img32.Fmt.PNG and Img32.Fmt.JPG are in you uses clause. Finally add a mainmenu option with the following OnClick event: procedure TForm1.SaveAs1Click(Sender: TObject); begin if SaveDialog1.Execute then ImagePanel.Image.SaveToFile(SaveDialog1.FileName); end; Edit: If the image has transparency, make sure you save it as in PNG format, otherwise you'll probably get a black background. Edit2: And if you don't want to add that extra bit of code, just make sure the image panel has focus (in SVG101) and click Ctrl+C. Then you can paste the result into your favorite image editor. Edited September 30, 2021 by angusj Share this post Link to post
misc_bb 7 Posted September 30, 2021 34 minutes ago, angusj said: Hi misc_bb. Yes, I think you are 😜. Try modifying the SVG101 sample by adding a TSaveDialog control (with filters for PNG and JPG file types). Then make sure both Img32.Fmt.PNG and Img32.Fmt.JPG are in you uses clause. Finally add a mainmenu option with the following OnClick event: procedure TForm1.SaveAs1Click(Sender: TObject); begin if SaveDialog1.Execute then ImagePanel.Image.SaveToFile(SaveDialog1.FileName); end; Edit: If the image has transparency, make sure you save it as in PNG format, otherwise you'll probably get a black background. Edit2: And if you don't want to add that extra bit of code, just make sure the image panel has focus (in SVG101) and click Ctrl+C. Then you can paste the result into your favorite image editor. Thanks Angus, I was actually considering this documentation from the site: http://www.angusj.com/delphi/image32/Docs/Units/Img32.Fmt.SVG/_Body.htm then I realized this was only a mere change of format maybe that's why the text layers were not considered. And when I applied the SVG101 for the same svg file it did show the text layers. Although they are a bit messed up due to the font styles but that's another story. How about without going through an ImagePanel will it still work? I'm seeing an error when I tried just declaring/creating ImagePanel on the fly without the actual component in the form. The error comes in during the LoadFromFile. Share this post Link to post
angusj 126 Posted September 30, 2021 (edited) 54 minutes ago, misc_bb said: I realized this was only a mere change of format maybe that's why the text layers were not considered Actually I forgot to mention 😱, you have to load some fonts before they can be rendered in Image32 (and SVG files only very rarely contain font resources). Image32 reads TrueType fonts both directly from files or indirectly through the OS as demo'ed in SVG101 ... procedure TForm1.FormCreate(Sender: TObject); begin ... FontManager.Load('Arial'); FontManager.Load('Arial Bold'); FontManager.Load('Arial Italic'); FontManager.Load('Arial Bold Italic'); FontManager.Load('Times New Roman'); FontManager.Load('Times New Roman Bold'); FontManager.Load('Times New Roman Italic'); FontManager.Load('Times New Roman Bold Italic'); and make sure you add Img32.Text to your uses clause. Also, you don't need to load a whole lot of fonts, just the ones that you'll need. More info here: http://www.angusj.com/delphi/image32/Docs/Units/Img32.Text/_Body.htm 54 minutes ago, misc_bb said: How about without going through an ImagePanel will it still work? You certainly don't need ImagePanel, that's just useful for displaying images on a form. You can just save images to file if you wish. Edited September 30, 2021 by angusj 2 Share this post Link to post
misc_bb 7 Posted September 30, 2021 @angusj Thank you so much! The font manager works like a charm! 1 Share this post Link to post
wuwuxin 28 Posted December 19, 2021 @angusi I am very interested in Image32 - forgive my dumb question - is it suitable to be used for developing CAD-like application, or interactive 2D graphics (that is based on user mouse dragging etc)? Thank you Share this post Link to post
angusj 126 Posted December 19, 2021 1 hour ago, wuwuxin said: is it suitable to be used for developing CAD-like application, or interactive 2D graphics (that is based on user mouse dragging etc)? Hi wuwuxin. Here are several short videos that demonstrate Image32's interactive capabilities... http://www.angusj.com/delphi/image32/Videos/img32.ctrls.mkv http://www.angusj.com/delphi/image32/Videos/layers301.mkv http://www.angusj.com/delphi/image32/Videos/layers201.mkv 3 1 Share this post Link to post
Edwin Yip 154 Posted December 20, 2021 (edited) 10 hours ago, angusj said: Hi wuwuxin. Here are several short videos that demonstrate Image32's interactive capabilities... http://www.angusj.com/delphi/image32/Videos/img32.ctrls.mkv The Image32-based controls demo is cool! And this seems to be a new feature added most recently. Edited December 20, 2021 by Edwin Yip Share this post Link to post
angusj 126 Posted December 20, 2021 42 minutes ago, Edwin Yip said: The Image32-based controls demo is cool! And this seems to be a new feature added most recently. It's a soon to be released **experimental** (or proof of concept) unit that creates visual controls entirely independant of VCL and FMX. However, these controls would really require a lot of work to make genuinely useful and ISTM that I'm probably just reinventing the wheel. Having said that this new Img32.CTRL unit could be very useful if there were reasonably simple Linux, Android and Mac equivalents of the Window's CreateWindow/WindowProc GUI. Share this post Link to post
TimCruise 2 Posted December 21, 2021 I tried to run exsamples FMX1 and FMX2 but both fail! Many errors were shown by the compiler. Anybody have success on these 2 examples? Share this post Link to post
angusj 126 Posted December 21, 2021 1 hour ago, TimCruise said: I tried to run exsamples FMX1 and FMX2 but both fail! Many errors were shown by the compiler. Hi Tim. What version of Delphi are you using? Older versions of Delphi don't contain the FMX library. Share this post Link to post
TimCruise 2 Posted December 21, 2021 (edited) 36 minutes ago, angusj said: Hi Tim. What version of Delphi are you using? Older versions of Delphi don't contain the FMX library. I am using the Delphi Community v10.4.2. I can run the bouncing green ball project, however. I am totally new to this software and catching up quite well. I guess it can help me to build a very large dashboard GUI. Edited December 21, 2021 by TimCruise Share this post Link to post
angusj 126 Posted December 21, 2021 10 minutes ago, TimCruise said: I am using the Delphi Community v10.4.2. I can run the bouncing green ball project, however. I am totally new to this software and catching up quite well. I guess it can help me to build a very large dashboard GUI. Hi again Tim. I see in another thread that you've installed Image32 as part of SVGIconImageList. I suspect the problem lies there and you may need to temporarily uninstall SVGIconImageList and reinstalling Image32 before compiling the FMX sample apps. Otherwise, I'm not aware of anyone else having problems with compiling the samples. 1 Share this post Link to post
TimCruise 2 Posted December 22, 2021 19 hours ago, angusj said: Hi again Tim. I see in another thread that you've installed Image32 as part of SVGIconImageList. I suspect the problem lies there and you may need to temporarily uninstall SVGIconImageList and reinstalling Image32 before compiling the FMX sample apps. Otherwise, I'm not aware of anyone else having problems with compiling the samples. Angus, If you can make a GitIT package, it will be much better. Share this post Link to post