Scaling Bitmap - page 4

 
Nikolai Semko:

Why 1000? Less then 200 :))

You are right, my fault, I opened the other file. 

 
Nikolai Semko #:

Example of scaling. It is made in a hurry and errors are possible.

Canvas.mqh is slightly edited

I used a black background bmp image but it is not transparent like your image!! 

what is difference?! 

 
Mahdi Ebrahimzadeh #:

I used a black background bmp image but it is not transparent like your image!! 

what is difference?! 

This is a transparent background issue in the BMP file. Some editors allow you to do this.

I would advise you to find a suitable PNG image with a transparent background and convert it to a BPM file, for example, on this resource:
https://onlinebitmaptools.com/create-transparent-bitmap

 
Mahdi Ebrahimzadeh #:

I used a black background bmp image but it is not transparent like your image!! 

what is difference?! 

By the way, change this file. It had a bug that led to image blinking.
\Include\Canvas\CImage\CImage.mqh 

Files:
CImage.mqh  14 kb
 
Nikolai Semko #:

This is a transparent background issue in the BMP file. Some editors allow you to do this.

I would advise you to find a suitable PNG image with a transparent background and convert it to a BPM file, for example, on this resource:
https://onlinebitmaptools.com/create-transparent-bitmap

Thanks Nikolai, You are awesome man. It works now :)

 
Mahdi Ebrahimzadeh #:

Thanks Nikolai, You are awesome man. It works now :)

No problem :))

 
Mikolaj Jan Migut #:

Hello Nikolai, I hope you're doing good. I have a question about bmp file format from your example code - what colour space / bmp type did you used while preparing this bmp file? I have a lot of issues with BMP files that I'm modifying using gimp or any online editors, basically transparency doesn't work for them. But it works perfectly with your file, so I would be grateful for some info what BMP format is required by mql or what program did you used to prepare the file, thanks!

Hello Mikolaj! 
The BMP format is essentially the absence of any format, since the image in it is stored in a native array of pixels, like on a screen.  One pixel is 4 bytes.  The high byte (left) is responsible for transparency if transparency is supported by the system.  If not supported, then this byte is simply ignored.  The remaining 3 bytes are responsible for the RGB color.  I gave a link above to an online resource where files with transparency can be converted to BMP format.  If I need to work with a bitmap, which happens very rarely, then I use Photoshop or Corel Paint.
 
Nikolai Semko #:
Hello Mikolaj! 
The BMP format is essentially the absence of any format, since the image in it is stored in a native array of pixels, like on a screen.  One pixel is 4 bytes.  The high byte (left) is responsible for transparency if transparency is supported by the system.  If not supported, then this byte is simply ignored.  The remaining 3 bytes are responsible for the RGB color.  I gave a link above to an online resource where files with transparency can be converted to BMP format.  If I need to work with a bitmap, which happens very rarely, then I use Photoshop or Corel Paint.
This is not correct. - BMP files have a header and have, specified in the header, different data interpretations.

Most important, the header specifies things like width and height, but also the data encoding, like 8, 16, 24 and 32 bit, and details about a color palette, if used....

Basically it is not a format less data file.
 
Dominik Christian Egert #:
This is not correct. - BMP files have a header and have, specified in the header, different data interpretations.

Most important, the header specifies things like width and height, but also the data encoding, like 8, 16, 24 and 32 bit, and details about a color palette, if used....

Basically it is not a format less data file.
All I wanted to say is that the data (array of pixels) in the BMP file is not packed.  The fact that there is a heading is obvious even to a child.  I said everything correctly, but you just misunderstood me.
 
Nikolai Semko #:
All I wanted to say is that the data (array of pixels) in the BMP file is not packed.  The fact that there is a heading is obvious even to a child.  I said everything correctly, but you just misunderstood me.
I see.

My addition was to give your statement some context.

Edit:

If there is a color palette in use, it is in fact packed, similar to a zip file.