Should R0 on entry not have bit0 set,
i.e. SYS "JPEG_FileInfo",1,path$ TO ,,x%,y%
SYS "JPEG_FileInfo",0,path$ TO ,,x%,y%
In article <59ef9fa796chrisjohnson@spamcop.net>,
News <chrisjohnson@spamcop.net> wrote:
Should R0 on entry not have bit0 set,
i.e. SYS "JPEG_FileInfo",1,path$ TO ,,x%,y%
Oh dear, indeed! Problem partly solved.
And for a sprite?
Sprite files contain multiple sprites, so you would need to specify
which sprite you wanted dimensions of.
I have no clue on the ChangeFSI functions, but what version are you
using? Also, what version of RISC OS?
The images you are dragging from, into your window, where are they
coming from? I.e., a file? another application?
At this moment I use the ChangeFSI library for the conversion, as described in a document called "CmdBasUse", found within the ChangeFSI application directory. After having typed "LIBRARY "<ChangeFSI$Dir>.ChangeFSI" at the
top of my program, I have access to the following function:
In article <56KdnRloBeIyTAn_nZ2dnUU7-S3NnZ2d@brightview.co.uk>,
Gerald Holdsworth <nospam@hollypops.co.uk> wrote:
I have no clue on the ChangeFSI functions, but what version are you
using? Also, what version of RISC OS?
ChangeFSI 1.63
RISCOS 5.29
The images you are dragging from, into your window, where are they
coming from? I.e., a file? another application?
The images come from disk, typically photographs. So, not from a file, nor from another application.
RISC OS 5.29 may be able to handle, and convert, JPEGs natively. !Paint
can certainly import a JPEG and output a Sprite, and it can also export
a JPEG.
I'd have a hunt around the RO5 PRMs to see if there is anything,
or post on the ROOL forums.
In article <ZeadnfdmIvFTZAn_nZ2dnUU7-WfNnZ2d@brightview.co.uk>,
Gerald Holdsworth <nospam@hollypops.co.uk> wrote:
RISC OS 5.29 may be able to handle, and convert, JPEGs natively. !Paint
can certainly import a JPEG and output a Sprite, and it can also export
a JPEG.
Yes, I know. And both !ArtWorks and !DPlingScan can perfectly resize any bitmap as well. But the point is that I want to do it myself - or better: I don't want to force possible users of my program to be dependent of those (commercial) programs. And I want to figure out how those programs do it...
In article <ZeadnfdmIvFTZAn_nZ2dnUU7-WfNnZ2d@brightview.co.uk>,
Gerald Holdsworth <nospam@hollypops.co.uk> wrote:
RISC OS 5.29 may be able to handle, and convert, JPEGs natively.
!Paint can certainly import a JPEG and output a Sprite, and it
can also export a JPEG.
Yes, I know. And both !ArtWorks and !DPlingScan can perfectly
resize any bitmap as well. But the point is that I want to do it
myself - or better: I don't want to force possible users of my
program to be dependent of those (commercial) programs. And I want
to figure out how those programs do it...
I'd have a hunt around the RO5 PRMs to see if there is anything,
or post on the ROOL forums.
I did find some related posts on the ROOL forum, but not helpful
enough for me to tackle the problem. Probably I will have to admit
that the WIMP is too complex for me.
The images come from disk, typically photographs. So, not from a
file, nor from another application.
I do not think it is the Wimp that is your problem.
I suspect your problem with sprites is that a sprite file can (and
usually does) contain several sprites. [ ... ]
What I meant was that I'm sure that if !Paint can do this, then the RISC
OS SWI calls can probably do it. I.e., I'm wondering if !Paint is just a wrapper around the OS_Sprite calls.
used from the command line
However, it looks from the documentation I looked at that the function FNChangeFSI is used from the command line. I am not sure whether it can
be used from a wimp program.
In article <_-CdncrtZoeZZQj_nZ2dnUU7-UPNnZ2d@brightview.co.uk>,
Gerald Holdsworth <nospam@hollypops.co.uk> wrote:
What I meant was that I'm sure that if !Paint can do this, then the RISC
OS SWI calls can probably do it. I.e., I'm wondering if !Paint is just a
wrapper around the OS_Sprite calls.
Ah, I see what you mean. But since I still have to scale the resulting sprite, I could as well use the ChangeFSI function right away.
Incidentally, if you wanted to see how many sprites are in a file without loading the entire file, just look at the first four bytes - this is the total number of sprites in the file. This is different to a sprite area
where the area size is the first four bytes, then the number of sprites.
On 31/05/2022 14:30, Paul Sprangers wrote:
In article <_-CdncrtZoeZZQj_nZ2dnUU7-UPNnZ2d@brightview.co.uk>,
Gerald Holdsworth <nospam@hollypops.co.uk> wrote:
What I meant was that I'm sure that if !Paint can do this, then the
RISC OS SWI calls can probably do it. I.e., I'm wondering if !Paint is just a wrapper around the OS_Sprite calls.
Ah, I see what you mean. But since I still have to scale the resulting sprite, I could as well use the ChangeFSI function right away.
OS_SpriteOp 52 paints a scaled sprite onto the screen. I can't see any
calls to rescale a sprite as a new sprite in the area.
In terms of quality you are much better off using ChangeFSI, since
SpriteOp 52 scales down in a very naive way, which causes massive
aliasing effects, while ChangeFSI interpolates between pixel values and
uses error diffusion.
In article <mpro.rd434c0075...@mw-software.com>,[...]
Martin Wuerthner <spam...@mw-software.com> wrote:
In terms of quality you are much better off using ChangeFSI
I can confirm that. ChangeFSI does a very good job from within a BASIC program, but not by using its library function as described in the documentation. At least, I certainly failed to get it working. Using the command line instruction however, and start that as a Wimp_Task, did the trick. No need to mess with local memory blocks or sprite areas or
whatever. It rescales every JPEG, no matter how large, to the desired dimension, quickly and transparently.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 56:27:07 |
Calls: | 6,652 |
Calls today: | 4 |
Files: | 12,200 |
Messages: | 5,330,869 |