| View previous topic :: View next topic |
| Author |
Message |
Laszlo
Joined: 14 Feb 2005 Posts: 4517 Location: Boulder, CO
|
Posted: Sat Jan 31, 2009 11:44 pm Post subject: |
|
|
| How did you get your bitmap? |
|
| Back to top |
|
 |
Glasso Guest
|
Posted: Sun Feb 01, 2009 12:14 am Post subject: |
|
|
Thank you for helping me figure this out, it is kind
The bitmap was generated from Lexikos & TIC's functions, such as
| Code: |
pBitmap := Gdip_CreateBitmap(500,500, 0x26200A)
|
... it goes deeper into other related functions to pBitmap
G := Gdip_GraphicsFromImage(pBitmap)
;;; but what I want to do is turn the pBitmap into HEX BUFFER where it is appropriate and possible to do so can you please show example how to? ...  |
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4517 Location: Boulder, CO
|
Posted: Sun Feb 01, 2009 2:54 am Post subject: |
|
|
| Unfortunately, I am not an expert in that. You have to ask those guys. The returned bitmap can be a C++ class or a structure, where the size can be calculated from the fields in the beginning. You have to know the size, when you want to convert the bitmap to hex. |
|
| Back to top |
|
 |
Glasso Guest
|
Posted: Sun Feb 01, 2009 4:30 am Post subject: |
|
|
Thank you for the insight there and idea. I will ask them to visit here, and maybe this can be expanded  |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 4473 Location: Qld, Australia
|
|
| Back to top |
|
 |
Glasso Guest
|
Posted: Sun Feb 01, 2009 9:57 pm Post subject: |
|
|
Thank you Lexikos.
Might you know a faster way to turn a bitmap into some kind of usable text code? I thought this hex conversion under this thread would be fabulous, ... though the Lexikos function does sort of what I am asking, ... it takes a darn long time to fully scan in even a small image before it is turned into text.  |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 4473 Location: Qld, Australia
|
Posted: Sun Feb 01, 2009 10:12 pm Post subject: |
|
|
| Are you using ImageData_GetPixel? Pass the ImageData variable to Bin2Hex instead. |
|
| Back to top |
|
 |
Glasso Guest
|
Posted: Sun Feb 01, 2009 11:39 pm Post subject: |
|
|
Pretty cool Lexikos! I think I am almost there!, ... But how would I get the correct size of ImageData right for this function
| Code: |
Bin2Hex(&ImageData,datasize)
|
|
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 4473 Location: Qld, Australia
|
Posted: Mon Feb 02, 2009 8:49 am Post subject: |
|
|
| Code: | ImageData_GetSize(ImageData, Width, Height)
SizeInBytes := Width * Height * 4 |
|
|
| Back to top |
|
 |
Glasso Guest
|
Posted: Tue Feb 03, 2009 3:20 am Post subject: |
|
|
Sweet  |
|
| Back to top |
|
 |
Glasso Guest
|
Posted: Tue Feb 03, 2009 3:39 am Post subject: |
|
|
Lexikos - THANK YOU
i have just one more question. i get the flow of this now in terms of hex conversion, but question boggles my mind
1) what is IMAGEDATA, .. this is not a bitmap, or is it? not the same as PBITMAP or HBITMAP?
2) i am used to working with P & H bitmaps. may i ask, so i can see the end to end conversion, ... if IMAGEDATA is neither a pbitmap or hbitmap, what would be the step to take IMAGEDATA and convert it to either one of those?  |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 4473 Location: Qld, Australia
|
Posted: Tue Feb 03, 2009 8:56 am Post subject: |
|
|
1) ImageData is a raw bitmap - i.e. an array of 32-bit pixel data.
2) I suggest you post in a GDI+ related thread, or start a new one.
GDI+ has very little to do with this thread. |
|
| Back to top |
|
 |
Glasso Guest
|
|
| Back to top |
|
 |
Glasso2 Guest
|
Posted: Fri Feb 13, 2009 6:34 am Post subject: |
|
|
Laszlo,
I am having some problems with the MCODE function, ... basically I am having trouble clearing it out. If I pass a variable that happens to be smaller than the last one, ... it actually leaves a ghost of the tail of the last variable passed in. I suppose in the loop when it allocates the memory, it doesn't do anything to re-initialize itself, assuming something else was passed in before
Do you know how to fix this somehow
pls see:
http://www.autohotkey.com/forum/topic40937.html |
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4517 Location: Boulder, CO
|
Posted: Fri Feb 13, 2009 6:39 am Post subject: |
|
|
| Glasso2 wrote: | | If I pass a variable that happens to be smaller than the last one, ... it actually leaves a ghost of the tail of the last variable passed in. |
| AHK Help wrote: | | to explicitly shrink a variable, first free its memory with VarSetCapacity(Var, 0) and then use VarSetCapacity(Var, NewCapacity) |
|
|
| Back to top |
|
 |
|