Author |
Topic |
spetric
Croatia
308 Posts |
Posted - Dec 14 2016 : 06:35:24
|
Hi Klaus,
I hope that I'll finish the first version of DLL engine until the end of this week and make a simple Delphi demo on how to use it.
|
|
|
klausdoege
Germany
389 Posts |
Posted - Dec 16 2016 : 16:38:07
|
Hi Spetric, fine, i would be happy regards Klaus
Klaus www.klausdoege.de |
|
|
w2m
USA
1990 Posts |
Posted - Dec 19 2016 : 12:43:24
|
WPCubed PDF Plugin for ImageEn Demo by William Miller/Adirondack Full Source Compiled with Delphi Seattle, but is expected to compile with Delphi 2010 or higher. Price: Free
This demo shows how to use the WPCubed PDF Plugin for ImageEn. The WPCubed PDF Plugin for ImageEn may be purchased here: http://www.shareit.com/product.html?productid=300747111
The plugin is a third party plugin written for use with ImageEn. The simple plugin allows editing pdf file frames as TIEBitmaps just like other supported file formats.
I found the instructions and the demos provided with the plugin was not correct and did not function which caused me to modify one of the demos to compile and function properly. I found that it was critical that the plugin is initialized in the initialization selection of the main form of each project that uses the plugin: { Initialize the WPViewPDF plugin }
{$I PDFLicense.INC}
initialization
glWPViewPDF_DLLName := WPViewPDF_DLLName;
glWPViewPDF_DLLName64 := WPViewPDF_DLLName64;
glWPViewPDF_LicName := WPViewPDF_LicName;
glWPViewPDF_LicKey := WPViewPDF_LicKey;
glWPViewPDF_LicCode := WPViewPDF_LicCode;
procedure TForm1.FormCreate(Sender: TObject);
begin
if TIEWPCubedPDF.Initialize then
TIEWPCubedPDF.RegisterPlugin
else
MessageBox(0, 'PDF decoder DLL could not be found.', 'Error',
MB_ICONERROR or MB_OK);
end;
Make sure that the path to the WPCubed PDF plugin is added to the IDE's library path. This demo can open multiframe tiff or pdf files and shows how to convert pdf to tif files and how to export selected frames to a tif file.
The WPCubed PDF Plugin for ImageEn eliminates the need to install and use ImageMagick and GhostScript to add pdf file support to ImageEn. Previously my testing found it was not possible to get the frame count of pdf files using ImageMagick and GhostScript so it was not possible to load frames into TImageEnMView. Although not measured, the time to load pdf files was much faster with TIEWPCubedPDF than with ImageMagick and GhostScript.
The ability to convert selected frames to grayscale or Black and White was added to answer a question in the forum.
The WPCubed PDF Plugin for ImageEn is highly recommended for those developers requiring the ability to process PDF files with ImageEn.
Download: attach/w2m/20161219125045_WPPDF_Multi.zip 126.11 KB
Note: ImageEn now also supports PDF loading via the PDFium plug-in
Bill Miller Adirondack Software & Graphics Email: w2m@hughes.net EBook: http://www.imageen.com/ebook/ Custom Commercial ImageEn Development
|
|
|
xequte
38654 Posts |
|
Fábio Nascimento
Brazil
72 Posts |
Posted - Dec 22 2016 : 05:58:46
|
Thanks for the demo, Bill! Merry xmas and happy new year to you all! |
|
|
spetric
Croatia
308 Posts |
Posted - Dec 22 2016 : 17:16:29
|
Oh well, I really put an effort to build so-so Delphi demo for my drawing engine.
Engine is written in C++ and it's quite fast and lightweight (1.4MB). I did not build x64 version, but it's not a problem. However, I want to do some more testing and probably some more changes before X64 version.
Also, I need to write a manual on how to use the engine (lot of parameters). I'll write it down if there is an interest, of course.
Currently only draw-rendering is supported and some options are not exposed in demo program. I'm not "per tu" with Delphi and this was a nightmare for me (volunteers needed). It's a new drawing engine for my prog. Pixopedia and this is a dll version of the engine (almost the same parameters). You can use brush bucket (multiple brushes: speSetBucketIndex function) but it's not implemented in current demo. Setting palette functions are exposed, but not available in demo (you can add them). Demo is built with Devexpress trackbars and color combos, but you can replace them with any others. Initial image is white canvas and right mouse click on the image pops-up available shapes (polyline, polygon and spline are not yet in dll).
Here is dll, demo exe and demo source code:
attach/spetric/2016122217524_delphi_spe_demo.zip 6538.68 KB
Oh yes, I forgot. Currently engine's surface accepts only unfragmented TIEBitmpa(s): IEGlobalSettings().AutoFragmentBitmap := False;
It's not a problem to add a method that can accept fragmented bitmaps, but you'll have to pass an array of scanlines. Any image container that has scanlines or some kind of contiguous buffer with known stride can be passed to engine's surface.
@klaus Sorry Klaus, I did not have time to put tessellation into engine. I'm thinking of creating a new dll (it will depend on spEngine.dll) with various effects (tessellation will be the first one).
|
|
|
yogiyang
India
727 Posts |
Posted - Dec 22 2016 : 23:28:24
|
Hello spetric,
Are there any possibilities to drawing Strokes around marquee selection with one command provided selection exist....?
TIA
Yogi Yang |
|
|
spetric
Croatia
308 Posts |
Posted - Dec 23 2016 : 02:39:09
|
Hi Yogi,
I think you mean something like this:
I have this option in Pixopedia and it can draw strokes around selection (actually it can draw strokes around multiple selections). There is no difference between polyline/polygon drawing and selection drawing, as selection is polygon.
However, in this version of dll (let's call it 0.1) I did not implement polyline/polygon drawing (it's actually inside dll, but not exposed).
I will add it in next version (together with selection clipping).
|
|
|
yogiyang
India
727 Posts |
Posted - Dec 23 2016 : 23:07:55
|
Hello spetric,
Yes! that is exactly what I am talking about.
TIA
Yogi Yang |
|
|
klausdoege
Germany
389 Posts |
Posted - Dec 27 2016 : 12:48:40
|
Hello Spektric, Unfortunately, I can not test the demo, the TCX components are missing. But it looks very promising.
Klaus www.klausdoege.de |
|
|
spetric
Croatia
308 Posts |
Posted - Jan 11 2017 : 16:09:53
|
I've built a new version of the spEngine (32 and 64-bit). There are lot of changes and additional functions, such as drawing ellipse/rectangle/polyline/polygon programmatically. All objects (including ellipse and rectangle) can be rotated by given angle.
I even wrote a manual (PDF), partially, because in the next version there will be some changes in structures, but not the parameters already in use. To avoid usurping the space on ImageEn forum, you can download the library from my site:
http://www.sigmapi-design.com/archive/spEngine.zip
Library is free but donations are welcomed
|
|
|
w2m
USA
1990 Posts |
Posted - Jan 12 2017 : 14:28:35
|
I am studying the new spEngine demo. I find that nothing is drawn in OnMouseDown. I am using a solid brush. It seems like a single solid ellipse should be drawn in OnMouseDown, but it does not. Does your demo draw a single ellipse in the OnMouseDown event?
Bill Miller Adirondack Software & Graphics Email: w2m@hughes.net EBook: http://www.imageen.com/ebook/ Custom Commercial ImageEn Development |
|
|
spetric
Croatia
308 Posts |
Posted - Jan 12 2017 : 14:53:31
|
Hi Bill,
In demo program, in OnMouseDown event nothing is drawn, because both ellipse radius are 0:
PaintView.ObjLeft[_hobj] := X;
PaintView.ObjTop[_hobj] := Y;
PaintView.ObjWidth[_hobj] := 0;
PaintView.ObjHeight[_hobj] := 0;
OnMouseDown event is used to prepare ellipse for drawing and temporary iekEllipse object is created.
In OnMouseMove event, you actually "stretch" the ellipse:
rect.left := MouseData.X_down;
rect.top := MouseData.Y_down;
rect.right := MouseData.X_move_to;
rect.bottom := MouseData.Y_move_to;
rect.NormalizeRect;
PaintView.ObjLeft[_hobj] := rect.left;
PaintView.ObjTop[_hobj] := rect.top;
PaintView.ObjWidth[_hobj] := rect.Width;
PaintView.ObjHeight[_hobj] := rect.Height;
In OnMouseUp event iekEllipse object is removed and rendering is performed according to given parameters. |
|
|
w2m
USA
1990 Posts |
Posted - Jan 12 2017 : 14:58:35
|
I am using a solid brush, not an object.
Shouldn't this draw?
if AShapeType = px_shpFreeHand then
speHandMouseDown(Shift, X, Y) <<==== Draw Bill Miller Adirondack Software & Graphics Email: w2m@hughes.net EBook: http://www.imageen.com/ebook/ Custom Commercial ImageEn Development |
|
|
spetric
Croatia
308 Posts |
Posted - Jan 12 2017 : 15:38:29
|
Oh, I see...you are using "free hand" drawing, not en ellipse.
In OnMouseDown event, actually in speHandMouseDown(Shift, X, Y) API, nothing is drawn, because internally "free hand" drawing calculates points on the Bresenham's line and so I need two points X_from,Y_from -> X_to, Y_to.
Furthermore, not all points on the line (X_from,Y_from, X_to, Y_to) are taken into the account, because it depends on the step set (default is 2).
Actual drawing with "free hand" option is performed in OnMouseMove event (speHandMouseMove(Shift, X, Y) API).
BTW, clear button in demo program does not work correctly, I must correct this.
|
|
|
w2m
USA
1990 Posts |
Posted - Jan 12 2017 : 15:40:31
|
ok, thanks... but to be useful in many cases I think OnMouseDown with "freehand" drawing should somehow draw.
Bill Miller Adirondack Software & Graphics Email: w2m@hughes.net EBook: http://www.imageen.com/ebook/ Custom Commercial ImageEn Development |
|
|
spetric
Croatia
308 Posts |
Posted - Jan 12 2017 : 16:02:27
|
Yes, you're right, it should draw a brush tip at point (X,Y). I'll add an option for that in the next version, something like DrawOnMouseDown := True/False; and then exclude that point from line drawing in OnMouseMove event.
However, it will work only in slow rendering mode (because of filters).
While I was running demo program, I found a bug exactly in free hand drawing. In on shape's MouseUp event it was written:
bool TGrapHand::MouseUp(TShiftState Shift, int X, int Y)
{
return TGrapBasic::MouseMove(Shift, X, Y);
// It should be MouseUp from the base class!!!
}
And that's the reason why clear button did not work correctly, actually free hand drawing in MouseUp event did not clear mask under the bounding rectangle. I'll upload corrected dlls tomorrow.
|
|
|
w2m
USA
1990 Posts |
|
spetric
Croatia
308 Posts |
Posted - Jan 12 2017 : 17:22:51
|
Done.
http://www.sigmapi-design.com/archive/spEngine.zip
If RenderParams.DrawTipOnMouseDown := True; (as in new demo version) brush tip is drawn in onMouseDown (for free hand shape). It will work for all rendering modes. I used a dirty trick and internally created a line (x,y -> x+1,y) and rendered only the first pixel. Bug in speHandMouseUp API corrected. |
|
|
spetric
Croatia
308 Posts |
Posted - Jan 30 2017 : 18:22:38
|
I made a little dll (32-bit only) that can load and execute 8bf plug-ins:
The same model as with drawing engine, but much simpler. Only ten functions and one typedef. I even wrote a Delphi demo and unbelievable, it works...well, for most filters (some newer ones tend to crash badly).
Here is the zip file: http://www.sigmapi-design.com/archive/spHost.zip
Have fun, Siniša
|
|
|
Topic |
|