Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 3 Jahren, 4 Monaten
Letzter Beitrag:
vor 3 Jahren, 4 Monaten
Beteiligte Autoren:
RAUL2, Jose Antonio Garrido, Fabrice Harari

Solved [WD] How to draw a layout like this?

Startbeitrag von RAUL2 am 10.10.2014 20:30

Hello guys.

I have a client who has an industrial printer (offset). Thing is that he wants to input a paper size and the software must calculate -for instance- how many flyers can be printed, as well the layout to print. Example:

* Paper size: 70 x 100 (cm)
* Flyer size: 19 x 25
* Qty: 14 flyers
* Layout:
Note: there's a calculator exactly like this here: Flyer calculator

Even when I still didn't figured out how to make this calculation, my concern right now, is how to draw the layout in WD. Do you have any suggestion to start over?

Best regards.


Re: [WD] How to draw a layout like this?


the drawing is the easy part: an image field and the drawing functions (dxxxx)

As for the layout, I'm pretty sure there are algorithms out there doing that

Best regards

von Fabrice Harari - am 10.10.2014 20:45

Re: [WD] How to draw a layout like this?

Thanks Fabrice, I'll check out what you say about the algorithms.

von RAUL2 - am 10.10.2014 20:51

Re: [WD] How to draw a layout like this?

You can also use Shape controls.
One rectangle would be the paper, and all others would be the flyers.

One you know the correct positions, you can use the function ControlCreate to place the rectangles where you want:

ControlCreate(Name , Type,x, y , Width, Height) //actually not exact syntax, since I had a problem with some charactres.

José Antonio.

von Jose Antonio Garrido - am 11.10.2014 09:47

Re: [WD] How to draw a layout like this?

Hello José.

I'm doing just that: issueing shapes. The only drawback is that width and height props don't accept decimals in their values, and for that reason, there's a little offset in the draw sometimes.

Thanks everybody and kind regards.

von RAUL2 - am 15.10.2014 14:07

Re: [WD] How to draw a layout like this?

Hi Raul.

Well, a retangle of 100,35 pixels would not make sense. Use Round() function first to convert.

So you will have to:

1.Calculate the correct layout for a given number of rectangles and paper size.
2.Make algorith to transform those calculations to pixels, taking into account the avaiable width in pixels to represent them. This can be done more complex or simple, depending if the user can select distinct paper sizes, and you always want to make use of the whole avaiable width to represent the graphics.
3.Draw the graphics.

As Fabrice said, Drawing is the easy part.


José Antonio.

von Jose Antonio Garrido - am 15.10.2014 22:14
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.