New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Images ratio #302
Comments
If this issue is still of interest, could you please add some screenshots to demonstrate the benefit of your solutions. E.g. one screenshot with an image drawn by the original method and one of the same image drawn by the above method. And please add the html/css text for testing. Thanks. |
Sorry I didn't see your previous email, the thing is I don't remember what
I did, and I think (or thought) it was a problem only by my side, something
about the dpi in my app probably. But as I don't remember very well, I
believe the code I included at least fixed my problem. I don't remember if
it was that the ratio width/height was as accurate as I thought the html
expressed, or was a overall size problem. Sorry.
El vie, 27 ene 2023 a las 18:20, BerndGabriel ***@***.***>)
escribió:
… If this issue is still of interest, could you please add some screenshots
to demonstrate the benefit of your solutions. E.g. one screenshot with an
image drawn by the original method and one of the same image drawn by the
above method. And please add the html/css text for testing. Thanks.
—
Reply to this email directly, view it on GitHub
<#302 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AUDHOJSQGSN2V2KPOZA7KOLWUP7VFANCNFSM5AR37PFA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
The problems concern the scaling of the images, and it is not DPI dependent. In any case, solving with your solution, there are tons of other problems, which, after days of frustration trying to solve them, made me decide to abandon this component. The problems I haven't been able to solve concern the "td width" inside a "table" with a RadioButton inside, using the component on c++. In delphi it works fine, in c++ it doesn't assign the correct width. |
Hi, sorry I am sure it's my fault the problem, because it's very blunt, but I can't set images to draw with the right ratio, even modifying the css as I can read in many sites it will work. So for the moment and I'm sure that probably it's not of any interest to anyone, I'm modifying in htmlimages.pas the procedure ThtImage.Draw(Canvas: TCanvas; X, Y, W, H: Integer) this way (sorry I don't know how to indent lines in this editor):
`procedure ThtImage.Draw(Canvas: TCanvas; X, Y, W, H: Integer);
var
bm1, bm2: tbitmap;
begin
if Graphic <> nil then
begin
bm1:= tbitmap.Create;
bm2:= tbitmap.Create;
try
bm2.Assign(graphic);
bm1.SetSize(w, h);
setstretchbltmode(bm1.Canvas.Handle, COLORONCOLOR);
stretchblt(bm1.Canvas.Handle, 0, 0, w, h,
bm2.canvas.Handle, 0, 0, bm2.Width, bm2.Height,
srccopy);
Canvas.Draw(X, Y, bm1);
finally
bm1.Free;
bm2.Free;
end;
end;
end;`
The text was updated successfully, but these errors were encountered: