POV-Ray : Newsgroups : povray.off-topic : Low-level fun Server Time
29 Sep 2024 03:12:24 EDT (-0400)
  Low-level fun (Message 18 to 27 of 47)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Darren New
Subject: Re: Low-level fun
Date: 20 Sep 2009 13:47:30
Message: <4ab66ab2$1@news.povray.org>
Orchid XP v8 wrote:
> Yeah, MS asserts that COM is usable on other platforms as well.

I think what they mean is that COM, in *theory*, can be ported to other 
platforms. In much the same way that .NET can be reimplemented on other 
platforms.

> Anybody know how you actually do this?

We had to write dcom libraries to link to Tcl to do this. It was pretty 
ugly, and very fragile.

-- 
   Darren New, San Diego CA, USA (PST)
   I ordered stamps from Zazzle that read "Place Stamp Here".


Post a reply to this message

From: Orchid XP v8
Subject: Re: Low-level fun
Date: 20 Sep 2009 13:56:29
Message: <4ab66ccd$1@news.povray.org>
>> Yeah, MS asserts that COM is usable on other platforms as well.
> 
> I think what they mean is that COM, in *theory*, can be ported to other 
> platforms. In much the same way that .NET can be reimplemented on other 
> platforms.

The documentation seems to suggest that MS COM is based on some 
open-standard COM with a few extensions, and that it's *supposed* to 
interoperate with other implementations of that standard.

(Admittedly, if it's anything like IE and its "standards", this won't be 
much fun...)

>> Anybody know how you actually do this?
> 
> We had to write dcom libraries to link to Tcl to do this. It was pretty 
> ugly, and very fragile.

Heh. Fun.

Give me ARexx any day. :-P

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Darren New
Subject: Re: Low-level fun
Date: 20 Sep 2009 14:23:57
Message: <4ab6733d$1@news.povray.org>
Orchid XP v8 wrote:
> The documentation seems to suggest that MS COM is based on some 
> open-standard COM with a few extensions, and that it's *supposed* to 
> interoperate with other implementations of that standard.

I see.  The number of "standard" implementations of the same idea is tremendous.

> (Admittedly, if it's anything like IE and its "standards", this won't be 
> much fun...)

To be fair, a lot of what IE does was done before the post-hoc standards 
were written. Backward compatibility is a bitch.

> Give me ARexx any day. :-P

Agreed. That was pretty cool.

-- 
   Darren New, San Diego CA, USA (PST)
   I ordered stamps from Zazzle that read "Place Stamp Here".


Post a reply to this message

From: Orchid XP v8
Subject: Re: Low-level fun
Date: 20 Sep 2009 15:05:26
Message: <4ab67cf6$1@news.povray.org>
>> The documentation seems to suggest that MS COM is based on some 
>> open-standard COM with a few extensions, and that it's *supposed* to 
>> interoperate with other implementations of that standard.
> 
> I see.  The number of "standard" implementations of the same idea is 
> tremendous.

It's meant to be an extension of DCE RPC. (Indeed, I recall Ethereal 
used to mark the packets as such...)

>> (Admittedly, if it's anything like IE and its "standards", this won't 
>> be much fun...)
> 
> To be fair, a lot of what IE does was done before the post-hoc standards 
> were written. Backward compatibility is a bitch.

Heh. And yet, IE6 is still horribly broken, years after those standards 
were written.

>> Give me ARexx any day. :-P
> 
> Agreed. That was pretty cool.

...although possibly not for exchanging large quantities of data, or 
doing crazy stuff like embedding one document inside another. But for 
simple scripting, it sure made everything... simple.

Still, maybe WSH does the same.

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Darren New
Subject: Re: Low-level fun
Date: 20 Sep 2009 16:23:34
Message: <4ab68f46@news.povray.org>
Orchid XP v8 wrote:
> Heh. And yet, IE6 is still horribly broken, years after those standards 
> were written.

But IE6 is following the standards from the earlier IEs. In other words, IE8 
*still* follows the original netscape cookie spec, for example, rather than 
the new improved W3C spec, because there are dumb-ass programmers who think 
that if it works, it must be right.

> Still, maybe WSH does the same.

It does.

-- 
   Darren New, San Diego CA, USA (PST)
   I ordered stamps from Zazzle that read "Place Stamp Here".


Post a reply to this message

From: clipka
Subject: Re: Low-level fun
Date: 20 Sep 2009 19:30:29
Message: <4ab6bb15$1@news.povray.org>
Orchid XP v8 schrieb:
>>
>> To be fair, a lot of what IE does was done before the post-hoc 
>> standards were written. Backward compatibility is a bitch.
> 
> Heh. And yet, IE6 is still horribly broken, years after those standards 
> were written.
> 

No surprise, given that it's obsolete since two version increments :-P


Post a reply to this message

From: scott
Subject: Re: Low-level fun
Date: 21 Sep 2009 04:39:16
Message: <4ab73bb4@news.povray.org>
>> Of course it's available. Not the release version, but the betas.

Surely developers already have the release version to test everything is ok? 
I mean it's one month now until it goes on sale.

> They have a beta already? Damn, that was fast...

The betas have been out for *ages*.


Post a reply to this message

From: Invisible
Subject: Re: Low-level fun
Date: 21 Sep 2009 06:48:05
Message: <4ab759e5$1@news.povray.org>
Orchid XP v8 wrote:

> Well well, it appears there's already a library on Hackage that's 
> supposed to provide COM support.
> 
> Oh, would you look at that? It won't compile. What a *big* surprise...

So I asked the "vibrant Haskell community" about this. (Yes, the Haskell 
community that's supposedly one of the strongest selling points of the 
language.) Wanna take a guess how many people have bothered to reply?


Post a reply to this message

From: Tom Austin
Subject: Re: Low-level fun
Date: 21 Sep 2009 08:37:49
Message: <4ab7739d$1@news.povray.org>
Orchid XP v8 wrote:
> So now I'm wondering if Windows provides any easy way to load and save 
> bitmapped images. GDI appears to allow you to load and save in Windows 
> Bitmap format - arguably amoung the worst file formats *ever*. But what 
> about something more sane?
> 

Are you using .NET or VB6?
You can download .NET express for free
http://www.microsoft.com/express/vb/Default.aspx


I am currently working an application in .NET that works with image 
files (.BMP, .JPG, .PNG) - displays them, draws on them and saves them.

I've done it in both - without too much trouble and without DLL
hell.


.net - almost directly copied out of my application
colors a point
draws a rectangle
this is on a image in memory - it is not visible to the user
just assign the image to a image control to see it

********************************
********************************
********************************

Private MasterImage As Bitmap

MasterImage = New Bitmap(imageFilePath, False)

MasterImage.SetPixel(x, y, Color.CornflowerBlue)

Dim graphicsDrawer As Graphics

graphicsDrawer = Graphics.FromImage(MasterImage)

Dim penZoomLines As New Pen(Color.YellowGreen, 1)

penZoomLines.DashStyle = Drawing2D.DashStyle.Dash

Dim zoomRectangle As Rectangle

zoomRectangle.X = (FullCoords.Width / MasterImage.Width) * ZoomCoords.X

zoomRectangle.Y = 0

zoomRectangle.Width = (FullCoords.Width / MasterImage.Width) * 
ZoomCoords.Width

zoomRectangle.Height = FullCoords.Height

graphicsDrawer.DrawRectangle(penZoomLines, zoomRectangle)

MasterImage.Save("test.png", System.Drawing.Imaging.ImageFormat.Png)


********************************
********************************
********************************



Good luck getting your app going.


Post a reply to this message

From: Invisible
Subject: Re: Low-level fun
Date: 21 Sep 2009 08:50:46
Message: <4ab776a6$1@news.povray.org>
>> So now I'm wondering if Windows provides any easy way to load and save 
>> bitmapped images. GDI appears to allow you to load and save in Windows 
>> Bitmap format - arguably amoung the worst file formats *ever*. But 
>> what about something more sane?
> 
> Are you using .NET or VB6?

Nope. I'm using Haskell, everybody's favourit programming language.

Of course, you *can* quite easily load and save PNG or JPEG from 
Haskell. If you have GTK+ installed. No problem on Linux, but kinda 
unusual for Windoze. Oh, it *works* just fine. But it means anybody who 
wants to run your program needs GTK+ installed. Actually, not even 
installed, just the DLLs really. But there's about 20MB of them!

There's also a binding to something called "GD" which is supposed to do 
something similar.

I suppose the ultimate answer would be to write a native Haskell PNG 
codec. Then it will run everywhere Haskell does.



Looks like figuring out this COM stuff might also conceivably work... I 
guess we'll see, assuming anybody ever gets back to me about how to make 
the library compile.



Aside: The Haskell GTK+ binding has full support for both bitmapped 
graphics and vector graphics. Vector drawing uses Cairo, and is really 
delightfully easy to use. It can render to the screen, to memory, or to 
a file in one of several formats (PNG / JPEG / SVG / PDF / PS).

The bitmapped graphics... involves manipulating the low-level bitmap 
manually, all by yourself. This is *not* my idea of a fun time. Also, it 
took about a week of wading through the API to figure out how to work it.

In other words, vector graphics is very easy, bitmapped graphics is 
quite hard. So I wrote a library to make it easy. Now you can easily 
load and save bitmaps, and read or write pixels in them. One of my 
better achievements. But, as I say, you have to have GTK+ for it to work...


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.