4

If a bitmap is larger than 2500x2500 it does not rotate, otherwise it does.
The return value is always true. Are there any settings to set to increase size limit?

 pts[0].x := dynamicBMP.height;
 pts[0].y := 0; 
 pts[1].x := dynamicBMP.height;
 pts[1].y := dynamicBMP.width; 
 pts[2].x := 0; 
 pts[2].y := 0;

  y := plgblt(TempBmp.canvas.Handle,
              pts,
              dynamicBMP.canvas.Handle,
              0,
              0,
              dynamicBMP.width,
              dynamicBMP.height,
              0,
              0,
              0);
if y = false then
  raise Exception.Create('Plgblt failed');
  • 3
    Try the code [here](http://stackoverflow.com/a/10633410/937125). Can you replicate same behavior? – kobik Mar 04 '13 at 23:17
  • 3
    I can duplicate somewhat with your weird coordinates (white/empty output). It does a proper mirror here (both horizontal and vertical) with proper coordinates (3799x2508 bitmap): `pts[0].x:=dynamicBMP.width;` `pts[0].y:=dynamicBMP.height;` `pts[1].x:=0;` `pts[1].y:=dynamicBMP.height;` `pts[2].x:=dynamicBMP.Width;` `pts[2].y:=0;` – Sertac Akyuz Mar 04 '13 at 23:35
  • weird coordinates rotate 180 degrees not mirror. – Randol Berry Mar 05 '13 at 00:56
  • 2
    @Randol - That's the same thing with a horizontal and vertical mirror. Try it if you don't believe me. In any case if you want to have exactly 180 degrees rotation use the correct coordinates I have given. Your coordinates are wrong for a 180 degrees rotation. – Sertac Akyuz Mar 05 '13 at 01:11
  • kobik the plgblt function still fails with suggested code going to try GDI+ – Randol Berry Mar 05 '13 at 01:41
  • @SertacAkyuz misunderstood your coordinates yes same thing my -1 not sure why? I posted code for 180 when I was having trouble for 90 – Randol Berry Mar 05 '13 at 01:53
  • pts[0].x := dynamicBMP.height; pts[0].y := 0; pts[1].x := dynamicBMP.height; pts[1].y := dynamicBMP.width; pts[2].x := 0; pts[2].y := 0; – Randol Berry Mar 05 '13 at 01:53
  • -1 of original coordinates seem necessary if I put a single pixel line around bitmap it drops two sides if not there any thoughts? – Randol Berry Mar 05 '13 at 02:03
  • 3
    @Randol -1 tries to skew the image, it is the wrong solution for your border. Anyhow, I can duplicate the problem with a 90 degrees clockwise rotation, it outputs an empty bitmap. I have no idea how to workaround that. I suggest you to edit the question to have those coordinates. – Sertac Akyuz Mar 05 '13 at 02:07
  • @Sertac, I couldn't reproduce this (Windows 7 64-bit, Delphi 2009), but have you checked what returned `GetLastError` ? It's not mentioned in the reference, but even `PlgBlt` sets the last error. – TLama Mar 22 '13 at 12:25
  • @TLama - I don't remember checking it, but if it is setting the last error, it should either set it to 0 since the function does not fail, or wouldn't care setting it since the function does not fail. The last error could only be helpful if it is not PagBlt but some other failing function along the way setting the last error, and you're lucky enough that it's not overwritten with some other succeeding function. I duplicated the problem with W7x64 with Delphi either 2007 or XE2. – Sertac Akyuz Mar 22 '13 at 15:45

0 Answers0