dim w as integer
dim h as integer
g.ForeColor=&c000000
g.fillrect 0,0,g.Width,g.height
w=xpic.Width
h=xpic.Height
g.drawpicture xpic,50,50,w*10,h*10, 0,0,w,h
In older versions of RealStudio this code gave a nice crisp exploded view of a picture with each pixel 10x its original size
but today in Xojo it produces a BLURRY picture as if it were trying to blend colors to make a “pretty” picture… which has its place of course
but is NOT what I want or need in this situation.
Interesting thing is if I add (and switch back to Carbon)
g.useoldrenderer=true
just prior to the DrawPicture… I get exactly what I want… but the reason I am revisiting this project is to remove ALL deprecated features and convert it from CARBON to COCOA
Note : use of g.AntiAlias (true or false) has NO EFFECT on the output
Nope… and didn’t think it would… AntiAlias should only affect drawing YET to be done… where Xpic has already been drawn… it is “G” that has not been drawn yet.
Xojo is anti-aliasing each pixel within itself… with no regard to the anti-alias flag.
basically all that is doing is drawing it twice… once from Xpic to P, then from P to G
I am assuming you did not TRY the code, otherwise you would have seen this.
This DOES work under CARBON…if I set USEOLDRENDERER… but that forces use of QuickTime which has been deprecated
and it runs properly under WINDOWS as well.
Dave if you are trying to install Feedback on Mac and it failed open Disk Utility and click eject on the Feedback volume then click on Feedback.dmg and Open it and it should work. (I had to do this the other day, I think something was messed up in the Feedback internal updater.)
A non-plugin solution for you, because I have a feeling the MBS one isn’t helpful to you… For 10x scale, make a picture that is 10x the width and height of the original. Copy bits into it via RGBSurface, taking the x/10, y/10 pixel in the original for each pixel in the 10x scale copy. It’ll take 20x or more as long as a plugin, but you avoid having to use one.
Thanks Jason… Brad… the code Jason pointed to does exactly that…
Unfortunatly, my application needs to have this done VERY VERY Fast… as it is a realtime “Magnify glass” view to a photo… the DRAWPICTURE scalling is quite fast enough, and so I will just stay with USEOLDRENDERER and stay of of the Apple Store until XOJO decides this is worth their time and effort
[quote=71713:@Dave S]Thanks Jason… Brad… the code Jason pointed to does exactly that…
[/quote]
I figured the “how it works” was important. My bad. Anyway, relevant to that other discussion, you’ve found a very good example of something you can’t do nearly as efficiently in Xojo as with a plugin. This simply has to do with pointer arithmetic and the ability to tell the C compiler that you’d like a pointer variable kept in a register while you iterate over a row. There are many, many other common development tasks where a lower level C implementation will smoke a Xojo implementation, and for which performance matters in the problem size your app can tackle.
Not true… .I found an example of where when Xojo implemented Cocoa they made a mistake.
And if I decide it is a big enough issue, I will write my own solution… as stated before… to me it is more important to learn (and yeah as a 58 year old IT professional I still do that)… than it is to get it done quickly.