Scaling Bitmap - page 3

 
Amir Yacoby:

Well, I tried ResourceReadImage() and you were right, Taras. Seems like an error in documentation, but it fills the data[] array.

Now there is only the scaling of images. 

Right about what ? Which error in documentation ?

 
Alain Verleyen:

Right about what ? Which error in documentation ?


ResourceReadImage() doc says 2nd parameter (data[]) is input, while when I tried it the function itself fills it which means it is at least also an output parameter
 
Amir Yacoby:

ResourceReadImage() doc says 2nd parameter (data[]) is input, while when I tried it the function itself fills it which means it is at least also an output parameter
Ah yes, thanks.
 
Ex Ovo Omnia:

How do you guys rescale the bitmap label objects in your graphical interfaces, if the display DPI settings differs from default?

It seems like a simple question, but I am not an expert for picture formats, so some help would be appreciated. I can rescale the other objects, but I got no idea how to treat the bitmaps.

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

Canvas.mqh is slightly edited

Files:
Scaling.ZIP  399 kb
 

Hmmmm

Awesome.

 
Its not perfect yet
Files:
 

Lorentzos Roussos

Its not perfect yet

It does not work yet.


I recommend using the union for color decomposition. It's easier and faster:

union rgb
  {
   uchar             argb[4];
   uint              clr;
  };
...
rgb col;
col.clr=original_dataz[original_co];
uchar b=col.argb[0];
uchar g=col.argb[1];
uchar r=col.argb[2];
uchar a=col.argb[3];
 
Nikolai Semko:

It does not work yet.


I recommend using the union for color decomposition. It's easier and faster:

Thats brilliant. Thanks !
You must change the original dimensions of the image in the code for it to work.(if you did that , then theres an error) 

 
Nikolai Semko:

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

LOL, 1000 lines of code in a hurry :)

Thank you very much for your implementation, I appreciate it. 

 
Ex Ovo Omnia:

LOL, 1000 lines of code in a hurry :)

Thank you very much for your implementation, I appreciate it. 

Why 1000? Less then 200 :))

Reason: