Skip to content

Need a guide to use image scaling #16

Description

@ReMaxDSSTJ-pico

Hello.

First let me say thank you for creating this library and for the examples. I have learned how to use the library mostly from the examples.

I'm trying to use DrawImgMat to scale an image into a Canvas and it is very difficult for me to guess how to use it. There is no example code on how to use that functiona and the combitation with the cMat2D class.
So far my efforts yield only to a 1:1 scale. I have been able to use DrawImg and DrawRect and those functions work fine on the default Canvas.

I have an image that is 64x146 8BITMODE with Transparency.

I use first a call to PrepDrawImg(64,146,0,0,64 * 2,146 * 2,0,0,0,0,0) to prepare the matrix for a 2x scale.
Then I use

DrawImgMat(&Canvas, &SkullCanvas, 0, 0,64 *2, 146 *2, &Mat, DRAWIMG_TRANSP, 0);

I got an image that is 2x the original, but it is off center by the middle, and only 64,146 of the image is on display.

Is like scaling 2X then only displaying the original size, and not on the position 0,0 inside the Canvas, but on position 64,146.

This maybe is too much to ask, since you are not visiting this repo issue bucket since almost a year ago, but could you write a guide for using cMat2D and DrawImgMat for noobs like me?

Yes, the project has a web page, but sadly, I don understand why my code fails.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions