DAY 009:_PutImage
#1
Here is what it looks like in Wiki:

Quote:_PUTIMAGE [STEP] [(dx1dy1)-[STEP][(dx2dy2)]][, sourceHandle&][, destHandle&][, ][STEP][(sx1sy1)[-STEP][(sx2sy2)]][_SMOOTH]


Yikes! but all we are doing is copying an image from Source Image Handle and rectangular section to Destination Image Handle and rectangular section.

After working with it for awhile now this is what I see:
(for the moment ignore all that STEPping)

_PutImage rectangle, handle, handle, rectangle
2 line rectangles on either end of the parameters.
2 Image handles in the middle of the parameters.

What belongs to what, the order is: D,S,D,S 
D for Destination where you want the rectangle image to go.
S for Source where the image is coming from.
(Kind of an odd sequence but... let us continue.)

Now Rectangle knowledge from working with Line (left, top)-(right, bottom) format comes in handy here (as does the practice with Step). (top, left) corner to (bottom, right) corner defines the rectangle space we are grabbing from Source and then pasting into the Destination.

If you want to fill the whole destination rectangle with the image, leave destination rectangle blank and it will fill the destination image by default. Same with the other end, if you want to use the whole image from the Source handle leave the Source rectangle blank as default.

Where do image handles come from?
Well most important is the current screen image, it is 0 automatically.
You can start an Image handle, say IH& Long Type from
IH& = _LoadImage("Filename.ext")
or
IH& = _NewImage(width, height, colorMode) ' starts a container to draw and/or _PutImage and/or start font and print.

STEP allows you to use the last graphics command (x, y) as the start for the next graphics, a very handy use of step for images is to start with the (x,y) location of the top left corner of the rectangle and -Step(ImageWidth, ImageHeight) instead of adding width to x height to y and finding the absolute position value for the 2nd (x, y).

I think this covers the most common uses of _PutImage there are plenty more details to go over, maybe pick those off with discussion?
b = b + ...
Reply


Messages In This Thread
DAY 009:_PutImage - by bplus - 11-15-2022, 12:00 AM
RE: DAY 009:_PutImage - by bplus - 11-15-2022, 12:23 AM
RE: DAY 009:_PutImage - by bplus - 11-15-2022, 12:32 AM
RE: DAY 009:_PutImage - by PhilOfPerth - 11-15-2022, 01:25 AM
RE: DAY 009:_PutImage - by mnrvovrfc - 11-15-2022, 12:38 AM
RE: DAY 009:_PutImage - by james2464 - 11-15-2022, 01:09 AM
RE: DAY 009:_PutImage - by bplus - 11-15-2022, 01:22 AM
RE: DAY 009:_PutImage - by bplus - 11-15-2022, 01:49 AM
RE: DAY 009:_PutImage - by PhilOfPerth - 11-15-2022, 01:58 AM
RE: DAY 009:_PutImage - by bplus - 11-15-2022, 02:19 AM
RE: DAY 009:_PutImage - by SMcNeill - 11-15-2022, 02:33 AM
RE: DAY 009:_PutImage - by bplus - 11-15-2022, 03:18 AM
RE: DAY 009:_PutImage - by Pete - 11-15-2022, 03:25 AM
RE: DAY 009:_PutImage - by grymmjack - 08-27-2023, 10:32 PM
RE: DAY 009:_PutImage - by james2464 - 11-15-2022, 04:20 AM
RE: DAY 009:_PutImage - by SMcNeill - 11-15-2022, 11:23 AM
RE: DAY 009:_PutImage - by james2464 - 11-15-2022, 04:32 PM
RE: DAY 009:_PutImage - by madscijr - 11-15-2022, 03:54 PM
RE: DAY 009:_PutImage - by SMcNeill - 11-15-2022, 04:37 PM
RE: DAY 009:_PutImage - by james2464 - 11-15-2022, 04:43 PM
RE: DAY 009:_PutImage - by Pete - 11-15-2022, 04:43 PM
RE: DAY 009:_PutImage - by bplus - 11-15-2022, 04:52 PM
RE: DAY 009:_PutImage - by grymmjack - 09-02-2023, 02:57 PM
RE: DAY 009:_PutImage - by james2464 - 11-15-2022, 07:19 PM
RE: DAY 009:_PutImage - by SMcNeill - 11-15-2022, 07:33 PM
RE: DAY 009:_PutImage - by james2464 - 11-15-2022, 08:20 PM
RE: DAY 009:_PutImage - by james2464 - 11-15-2022, 08:49 PM
RE: DAY 009:_PutImage - by bplus - 11-15-2022, 11:22 PM
RE: DAY 009:_PutImage - by SMcNeill - 11-15-2022, 11:46 PM
RE: DAY 009:_PutImage - by james2464 - 11-16-2022, 12:10 AM
RE: DAY 009:_PutImage - by SMcNeill - 11-16-2022, 01:00 AM
RE: DAY 009:_PutImage - by james2464 - 11-16-2022, 01:27 AM
RE: DAY 009:_PutImage - by james2464 - 11-16-2022, 03:48 AM
RE: DAY 009:_PutImage - by SMcNeill - 11-16-2022, 03:55 AM
RE: DAY 009:_PutImage - by james2464 - 11-16-2022, 04:01 AM
RE: DAY 009:_PutImage - by grymmjack - 09-02-2023, 02:45 PM
RE: DAY 009:_PutImage - by grymmjack - 09-02-2023, 02:54 PM
RE: DAY 009:_PutImage - by bplus - 11-16-2022, 05:21 AM
RE: DAY 009:_PutImage - by SMcNeill - 11-16-2022, 04:07 AM
RE: DAY 009:_PutImage - by james2464 - 11-16-2022, 04:38 AM
RE: DAY 009:_PutImage - by grymmjack - 08-27-2023, 09:58 PM
RE: DAY 009:_PutImage - by bplus - 08-27-2023, 11:16 PM
RE: DAY 009:_PutImage - by grymmjack - 08-27-2023, 11:51 PM
RE: DAY 009:_PutImage - by grymmjack - 08-28-2023, 12:14 AM
RE: DAY 009:_PutImage - by a740g - 08-28-2023, 07:49 AM
RE: DAY 009:_PutImage - by grymmjack - 08-28-2023, 11:32 AM
RE: DAY 009:_PutImage - by grymmjack - 08-28-2023, 11:51 AM
RE: DAY 009:_PutImage - by bplus - 08-28-2023, 01:33 AM
RE: DAY 009:_PutImage - by bplus - 08-29-2023, 03:21 PM
RE: DAY 009:_PutImage - by grymmjack - 08-29-2023, 10:41 PM
RE: DAY 009:_PutImage - by grymmjack - 09-02-2023, 01:58 PM
RE: DAY 009:_PutImage - by grymmjack - 09-02-2023, 02:36 PM
RE: DAY 009:_PutImage - by grymmjack - 09-02-2023, 02:41 PM
RE: DAY 009:_PutImage - by grymmjack - 09-02-2023, 02:42 PM
RE: DAY 009:_PutImage - by grymmjack - 09-02-2023, 02:45 PM



Users browsing this thread: 3 Guest(s)