LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Artefacts on image display using CanvasDrawBitmap

I have some problems using CanvasDrawBitmap with gray level or color images.
 
Depending on the scaling ratio defined with the sourceRect and destinationRect parameters, it happens that the image is
displayed with square artefacts, these are particurlarly visible when the pixel value is dark.
 
Attached an example of the problem.
 
Can anybody help me to solve this ?
 
0 Kudos
Message 1 of 3
(3,160 Views)
Hello Vbr,

What is the color resolution of your display when you run this program? I think this might be a result of running in 256 color mode.

Also, do you notice the same effect if you load your bitmap into a picture control, with the fit mode set to "size to image to control" and you then resize the picture control to various sizes?

Luis

0 Kudos
Message 2 of 3
(3,147 Views)

Hi,

GetBitmapFromFile ("Sans titre.bmp", &ID);
CanvasDrawBitmap (mainpanel, MAINPANEL_CANVAS, ID, MakeRect (10, 10, 100, 100), MakeRect (10, 10, 100, 100));

Have you noticed that the first rect is the ROI of the image you want to display, and the second rect the position in which you want to display the image in the ROI?

So if you "cut " the image you will have a resized image

Let me know if you have questions

kamal
NIF

0 Kudos
Message 3 of 3
(3,133 Views)