(01-04-2026, 06:07 PM)Pete Wrote: Ah, you found a way to shrink it back to the original size, but...
Run the code again, but use t = _NewImage(120, 120, 32). It will still make our triangle in the upper left corner on the source image screen, but for some reason (I don't understand why) changing to a larger _NewImage screen ALSO changes the size of the triangle, and in both our codes.
So I tried messing around with: _PutImage (sx1, sy1 + TopTriangle)-(sx2, sy2 + TopTriangle), tri&, 0, (0, 0)-(15, 15) hoping the (0, 0)-(15, 15) would mean get just the area of _NewImage from the top-left to the width and height of the image, but no bueno! It still gave me the exact save stretch effect in the smaller _NewImage screen code.
It's cool _PutImage can do so many things, but until I get a better understanding of what exactly is needed to use it correctly in those various situations I'm probably just going to use my method, and just always draw a bloated _NewImage screen to avoid problems when I'm also inverting an image.
Still
_PutImage (sx1, sy1 + TopTriangle)-(sx2, sy2 + TopTriangle), tri&, 0, (0, 0)-(15, 15)
seem right idea, I wonder why didn't work for you? (only showing 2/3's width triangle though).
I like that your example uses STEP, which I haven't used before. I see how it works, but I don't understand it.
Pete
Here is the fix for the larger screen, take only the part you want from the source, else it shows the whole source which changes the tri's to dots (I think) because it's bigger screen to fit in little space.
Code: (Select All)
Width 80, 25: _Font 16
fw = _FontWidth: fh = _FontHeight
't = _NewImage(fw * 2, fh, 32)
' INCREASE _NEWIMAGE SCREEN SIZE TO SHRINK TRIANGLE TO: t = _NewImage(120, 120, 32)
t = _NewImage(120, 120, 32)
Screen t ' Remark or remove this line and Sleep: Screen 0 to hide image creation.
_Dest t
' Draw a triangle.
a = 6: c = 0
For i = 0 To 6
Line (a, c)-(a + i * 2, c)
a = a - 1
c = c + 1
Next
tri& = _CopyImage(t, 33)
Sleep: Screen 0 ' Remark or remove this line and Screen t to hide image creation.
_Dest 0
_FreeImage t
col = 32: row = 5: BarLength = 8
Locate row, col + 2: Print "__________Row"; row
Locate row + 8, col + 2: Print "__________Row"; row + 8
Locate row + 1, col
For j = 1 To BarLength
Locate , col: Print Chr$(219)
Next
sx1 = col * fw - fw - 2: sy1 = fh \ 2 - 2
sx2 = sx1 + c * 2 * fw: sy2 = sy1 + i * fh + 3
TopTriangle = row * fh - fh ' 1st num is row in Screen 0.
xfactor = fh * (i - 1) - TopTriangle
BottomTriangle = BarLength * fh
Do
_Limit 30
_PutImage (sx1, sy1 + TopTriangle)-Step(24, 16), tri&, 0, (0, 0)-(23, 15) '<<<<<<<<<<<<
_PutImage (sx1, sy2 - xfactor + BottomTriangle)-Step(24, -16), tri&, 0, (0, 0)-(23, 15) '<<
LoopSeems like you had the right idea with
_PutImage (sx1, sy1 + TopTriangle)-(sx2, sy2 + TopTriangle), tri&, 0, (0, 0)-(15, 15)
but wrong numbers, triangle is 24 wide
Update: this is where it went wrong: (sx2, sy2 + TopTriangle), you were making the destination box way too big.
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever


