Skip to content

Assign a Bitmap after a Large Resample #303

@maxm74

Description

@maxm74

If, after a larger resample, you assign the new resized image to an existing Bitmap, only part of the content is copied
(exactly the old unscaled bitmap size).

Open the test and load wia_take.bmp attached image using the ... button next to 'Picture to Open'.
Click 'Resize 200%'.
The test creates two new bitmap files, 'resized.bmp' and 'resized_assigned.bmp'.
If you open resized_assigned.bmp, you'll see the problem.

After a debugging session, I realized the problem lies in TCustomUniversalBitmap.CopyPropertiesTo (unibitmap.inc Line 2644),
which is the ClipRect copy.

Basically, Assign only copies the contents of ClipRect when it does PutImage.
In my opinion, CopyPropertiesTo should be done after PutImage.

bgraBitTest.zip

mypatch.patch

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions